General C++ Programming - October 2017 (Page 12)

CAlculat students grades
 
This quest is going to improve upon the previous quest. We are now going to keep track of up to 30 student names and grades for up to 10 assignments. We should ...
[1 reply] : Hi, firstly, this isn't the way to take array limits cout << "how ... (by shadder)
map takes no class function as map_value parameter
 
Hi there, I want to process commands in a chat program I've started working on. The way I'm planning to do this is by having every command it's own function. ...
[1 reply] : #include <iostream> #include <string> #include <functional> #include ... (by JLBorges)
Refactor: Image - Printer - Draw
 
Hi, I just came from C, and I would like how to refactor this case for learning purposes. What I don't like from my code: - the way I choose if writing to st...
[no replies]
by stav
Circular include problem
 
hi, so i just started working on my first ever "big" c++ project and i've already ran in to a bit of a problem. i basically have these two classes: MeWindow an...
[1 reply] : First snippet: Line 5: delete the recursive include. Line 9: Incl... (by AbstractionAnon)
Number of occurances of minimum and maximum
 
I have the code written out. I need help with finding the number of occurrences of an already figured minimum and maximum. #include <iostream> #include <iom...
[1 reply] : if you read the file into a data structure you can use a pair of count... (by jonnin)
writing an iterative loop to compute sum of matrix
 
Consider a 2-d Matrix (square) of size N x N a column a. Write an iterative (loop) code segment (algorithm) to compute the sum of the values in each column ...
[3 replies] Last: row and col appear to be uninitialized. you probably need row=col=n;... (by jonnin)
3rd parameter to STL's priority_queue
 
Since I'm a beginner to STL,I'm having a hard time inferring what the third parameter is really all about. I read the documentation of priority_queue here htt...
[5 replies] Last: A functor is basically the type of a function. A comparator is a speci... (by coder777)
I don't get the errors
 
/*Ask the user to enter the option to pick between infix, prefix, or postfix. 2.Allow the user to enter a mathematical expression per the option above. 3.Allo...
[3 replies] Last: So test the program, perhaps under a debugger, and start fixing the er... (by JLBorges)
file output
 
I have this data 1 1000.25 2 55.25 3 9999.99 4 33.45 5 2000.00 6 1588.88 7 1699.99 8 14898.25 9 13734....
[1 reply] : After the loop on line 27, the input file will be in a failed state (t... (by JLBorges)
Operator Overload ( >, < )
 
I need help creating a function to overload the comparison operators ( > , < ) so that I can compare Cards from my Card class. The card are made up of a rank th...
[1 reply] : Something like this, perhaps: #include <iostream> #include <string> ... (by JLBorges)
Find all paths of a maze. Different than most.
 
I need to find all paths of a maze. I have looked up examples but they aren't any help. Please dont link me to any. I am using a 1D vector that acts like a 2D v...
[4 replies] Last: > It is very odd that you are able to move diagonally. 8-connected is... (by ne555)
Defining a range-checked iterator for vector
 
Hi all, The exercise 18 of chapter 20 of the book Programming Principle and Practice Using C++ says this: Define a range-checked iterator for vector (a rand...
[10 replies] Last: Thank you very much for your guidance. (by Frank14)
Creating a 50 x 50 grid
 
I had a question about C++ if anybody can answer it for me, I will really appreciate it. Say I create an output file and I want to create a 50 x 50 grid in t...
[4 replies] Last: You have a problem with your nested loops. Line 4: Each time though... (by AbstractionAnon)
switch statement
 
Q2: Use a switch statement with breaks between the cases. Create a program that asks the user for two float numbers. Then asks the user if they would like to: 1...
[2 replies] Last: Switch statement is used to switch between values . Each switch is te... (by Dungeon)
Could someone find the error that I get on this.
 
#include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { char vote1, vote2, vote3, vote4, vote5, vote6; int ye...
[3 replies] Last: 1) Please use code tags when posting code, to make it readable: http:... (by MikeyBoy)
nested while loop
 
good day, im having trouble converting for loop to while loop. i did the "input number of student having 3 quizes each and get the average" in for loop. the pro...
[5 replies] Last: First, you set your y value to 1. Then the outer while loop executes, ... (by goldenchicken)
Logic Question
 
I am looking for the best way to implement what I am trying to achieve. I am creating a basic first game program, and I have the movement working correctly by ...
[2 replies] Last: Yes, hah I am still learning. I will check that out, Thanks! (by closed account 4wvoLyTq)
Database queries pattern
 
Hello, new poster here I'm often creating programs with database access. The way I do it now is to have a class for each type. For example, let's say I'm cre...
[4 replies] Last: So there is no obvious way to do what I want? Yes, take a look how it... (by coder777)
Explain the following lines:
 
Background information: Insert at the front of a Deque(this data structure is made of doubly linked list, so a front and back Node pointer). void DequeList::...
[2 replies] Last: struct DequeList { struct Node { explicit Node( int v )... (by JLBorges)
Printing An array Class of Terms as Char & Int
 
I am working on building a deck of Cards and have a Class Card consisting of an integer for the card value 2-14 (Ace is high) and a character for the suite S, C...
[1 reply] : You have made the suite and value (rank) private, so you need to provi... (by Duthomhas)
October 2017 Pages: 1... 1011121314... 16
  Archived months: [sep2017] [nov2017]

This is an archived page. To post a new message, go to the current page.