Yes, I am another college student seeking help with an assignment, and no, I am not trying to find someone to do it all for me. I have been working on it since last Thursday. It is a problem designed to test one's knowledge of procedures. It should be simple enough, but for some reason, I just don't get procedures yet.
It is a problem to calculate the total cost of performing a paint job on 1 or more rooms. The program is designed to ask the user to input the number of rooms to be painted, the square footage of the room(s)(it is assumed for this assignment that the square footage of each room is the same; also we don't use the program to calculate the square footage...we just input an arbitrary number for square footage--after all, we're beginners), and the cost per gallon of paint used for the painting job.
Some information that is given includes: for every 100 square feet, one gallon of paint and 8 hours of labor is required. The labor charge is 18 dollars per hour.
We are supposed to use 3 procedures, passing parameters to the procedures without referencing global variables (I know it's bad programming to do that, but I could probably figure it out more easily if I were allowed to do that.
The first one of the procedures is supposed to accept input from the user, and that input is to be passed as a parameter (THIS IS ONE OF THE AREAS I'M HUNG UP ON) as well as input validation for the input that is accepted. You can't accept a value less than one for number of rooms, or a value less than $10.00 for cost of paint per gallon. Also, square footage is required to be a positive integer value.
The second procedure is supposed to calculate all the required details--gallons and cost of paint required, hours and labor charges, and total cost. As the instructions state, " be sure to properly pass parameters containing the needed inputs for the calculations, as well as parameters to return the calculated values".
The final procedure is to print: the # of gallons of paint required, the hours of labor required, the cost of the paint, the labor charges and the total cost of the the paint job. The calculated values are to be passed as parameters.
I don't quite understand yet how to pass a parameter, because I'm still not sure what that entails. I've been looking in books and on the web, and so far, nothing has helped me out that much.
I know that is a lot of info to digest, and I think I have the sequencing down, it's the calling and passing parameters stuff (the focus of the assignment) that I'm still confused about. I prefer not to post what I have done so far on the board...I'd rather email it to you. But if you insist I post it, leave a reply saying so, and I will make a fool out of myself by showing how little I know about programming. Thanks in advance.