| EJonah (7) | |||||
At the moment, that is my program i created. I'm having errors in my "count loop". Im trying to read count for the loop. Also i'm not sure if my whole program is correct. I need to: -write a program that calculates the installation cost and the total cost of installing a carpet. -Write the data using the printdata procedure. -The data will be read using a count controlled for loop. And the input should be: 3 (for the count) 23 13 18.20 //length, width, cost per square foot 28 15 20.60 14 11 25.53 Heres the shell or the psuedocode outline for the program)
Also im having errors in other parts of my program. If anyone can help and find the problem, that would be really grateful. Thank you! | |||||
|
|
|||||
| Moschops (5959) | |
cin >> count; //enter number of lines you wants Did you mean to store the number of lines in the variable named count? I think you meant to store it in the variable named numLines. while (count <= numLines)Here, you are comparing two variables. Your program only sets a value for one of them. What value is count supposed to have at the start of this loop? So the loop is meant to end when count matches numLines? Well then, how do you expect count to change? | |
|
Last edited on
|
|