- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
14 Posted Topics
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 … | |
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] | |
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. | |
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 … | |
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: " … | |
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( … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.