No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi, I have some basic code: cout << "HOW MANY BOTTLES IN THE BASKET? "; cin >>bottles; I want to put an if statement to make sure that no letters are entered and only numbers are? How would i do this? Thanks guys! |
|
Hi I got this code: (hours_worked[i]-35)=overtime_hours[i]; (overtime_hours[i])-(hours_worked[i])=normal_hours[i]; I get this error: error C2106: '=' : left operand must be l-value What does this mean? |
|
Hi, Can a user determine the size of an array through the programme? For example, At the beginning of the programme it will ask the user 'How many students' exams grades would you like to process today' Therefore create the array to be of the size that the user has … |
|
-------------------------------------------------------------------------------- Hi, I have a calculation (shown below): total[i]=(dogs[i] + cats[i]); I want to be able to store the answer for total[i] I stupidly tried to put a cin statement underneath but that doesnt work. when i used cin, my prog just waits for me to enter a value. What … |
|
Hi, I have a calculation (shown below): total[i]=(dogs[i] + cats[i]); I want to be able to store the answer for total[i] I stupidly tried to put a cin statement underneath but that doesnt work. What would i use? |
|
Hi, I have this code for an array: [code] { cout << "how many tins sold? " << (i+1) ; cin >> tinssold; cout << "how much is each tin?" << (i+1) ; cin >> tinprice; value=(tinssold*tinprice cout <<"total value of tins is " <<value; } [/code] IF I WANTED … |
|
Hi, I am using this code: int total = 0; for (i = 0; i < 3; i++) { total+=hours_run[i]; cout <<"\n"<<total; } The aim of this code is too add up the hours run by the 3 people who enter the values. The code above produces some weird results. … |