Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~5K People Reached
Favorite Forums
Favorite Tags
c++ x 67
Member Avatar for matrimforever

What do I need to gather all lines of numbers say 88 on one line, and 92 on the second and so on? I have: ifstream theFile("grades.txt"); theFile >> sc1 >> sc2 >> sc3;// this gives me each number, but I need to be able to read them all then …

Member Avatar for Comatose
0
1K
Member Avatar for matrimforever

How do I read data such as song titles from a file and store them in an array? I have: [code] const int SIZE = 50; int main() { char theFile[SIZE]; cout << "Please enter a file name: " << endl; cin.getline(theFile, SIZE); ifstream theFile(" "); ... [/code]

Member Avatar for Ancient Dragon
0
131
Member Avatar for matrimforever

How do i use the function isspace to take sentences read into an array and make multiple spaces only one space between words? Use an if statement? if (isspace([I]aChar[/I]) ) cout << aChar; else ( Not sure what I need here.

Member Avatar for bala24
0
204
Member Avatar for matrimforever

I need help figuring this out. What I need is this:[LIST=1] [*]The section number, as a string [*]The instructor's name, also as a string [*]The number of students in this section, as an integer. [*]The student's scores for the test, as an array of integers. Declare this array to be …

Member Avatar for Ancient Dragon
0
105
Member Avatar for matrimforever

i need a function: readData() to read in scores from a file. I can open a file up, but not sure how to code it so input from the user opens any file. [code] int readData() { cout << "Please enter in the path to the student score file: " …

Member Avatar for Ancient Dragon
0
84
Member Avatar for matrimforever

What I am trying to do: [quote][LIST=1] [*]A function to add one to the current count. [*]A function to subtract one from the current count. [*]A function to reset the count to zero. [*]A function that returns the current count.[/LIST]Do not write a constructor for this class. Write a main( …

Member Avatar for may4life
0
245
Member Avatar for matrimforever

In the following code, how do I change the line under [code] cout << "\nThe value of bogus in num1 is " << num1.bogus;[/code] to get it to compile correctly. I know its calling for theValue which is private. Not sure what to change to make it work: [code] #include …

Member Avatar for matrimforever
0
103
Member Avatar for matrimforever

Hi all, I need help turning this: W = 35.74 + 0.6215t - 35.75 (v0.16) + 0.4275t(v0.16) into code. I guess the real problem is the how to turn v to the .16th power using this function: double pow(double [I]x[/I], double [I]y[/I]) I know how to open a file with …

Member Avatar for matrimforever
0
163
Member Avatar for matrimforever

How do I call a function outside of main or use a parameter to pass a reference? If my function is: [code] void getData(int& diameter, int& price) { cout << "Enter in the diameter of the pizza in: " << endl; cin >> diameter; cout << "Enter in the the …

Member Avatar for matrimforever
0
124
Member Avatar for matrimforever

Hi, I need to write a n00b program that calculates the best deal customers can get when buying pizza. The premise is, although an extra large pizza may appear a better buy, you need to calculate the cost per sq inch of both round and rectangular pizzas to really know. …

Member Avatar for ~s.o.s~
0
2K
Member Avatar for matrimforever

We are discussing passing parameters by value and by reference in class and I need to come up with a function 'computeChange' from the following code: [code] // The function prototype int computeChange(int& changeValue, int coinValue); // some constants const int COINS[ ] = {50, 25, 10, 5, 1}; const …

Member Avatar for ~s.o.s~
0
165
Member Avatar for matrimforever

I can code things okay, but I have real trouble coming up with algorithims to solve problems. For instance this problem: 'A scientist uses rabbits (yes, another rabbit problem) in her experiments. She starts out with one pair(male,female). At the end of each month, a pair of rabbits produces one …

Member Avatar for matrimforever
0
361
Member Avatar for matrimforever

Hi, I'm trying to write a program that computes interest and check fees and then prints a new calculated balance. So far it works okay, but seems like I have a lot of unnecessary work. Can someone help me simplify it down plz? ps: The premium acct has no check …

Member Avatar for ~s.o.s~
1
119
Member Avatar for matrimforever

I am trying to write a simple program in c++ to take a beginning delivery time in 24 hour time and an ending delivery time then taking 25% off that time(making the end time 25% sooner). For example, i'd have a user enter in 0900 for start time and 1030 …

Member Avatar for FC Jamison
1
144