If and Else If statement quandary...

To preface this post, I want anyone who is interested in helping me know that the only reason I posted the entire assignment is to give you a better understanding of my problem.

I want to know how I can correctly, and without writing things over and over again, make a code (that preferably doesn't use any functions) which allows me to:
1. Have an "if" and/or an "else if" statement designed program that allows me to determine what size backhoe to use AS WELL as also determining what the cost is going to be for the labor and for using it.
2. Ditto above for every variable that has multiple dependencies... Such as if it uses XXX sq feet of tile, how would I write a code that picks the customers tile request and then calculates the cost of the tile and the cost of the labor.

... So is it a lot simpler than I'm making this out to be? I have never seen C++ before in my life and I would LOVE for someone not to write out the code but to write out a code that shows when and how to use the "if" and/or "else if" and anything else helpful that isn't a function.

Let's say that I have a program that I want to write, and this program will:
* Calculate the costs of labor and equipment for swimming pool installations.
* Equipment and labor needs are dependent on the volume and depth of the pool and whether the pool surface is to be surfaced with high gloss epoxy, standard epoxy, or tile.

* Pools no deeper than 6 feet can use the small backhoe that moves 100 cubic feet of earth per hour. Charge for the equipment is $45.00 per hour and $26.75 per hour for the operator.

* Pools over 6 feet deep and up to 11 feet deep require the medium backhoe that moves 200 cubic feet of earth per hour and costs $200.00 per hour and $46.50 per hour for the operator.

* Pools over 11 feet deep and up to 16 feet deep require the large backhoe which moves 350 cubic feet of earth per hour and costs $565.00 per hour and the operator is paid $76.55 per hour.
(Pools over 16 feet can't happen, so the data should be echoed, an error message should be printed and no costs reported.)

* The epoxy crew costs $110.00 per hour and can cover 300 square feet an hour. They also bill by the full hour. There is a $25.00 per 200 feet (or fraction) surcharge for high gloss in addition to the other charges.

* The tile crew costs $90.00 per hour and can cover 145 square feet an hour. They also bill by the full hour.

* Only one backhoe is brought to a job site.
---------------
* You are given an input file with the information about several jobs. I'll put one in here for you to see.

1. Line one: Customer Name (Too Hot Joe)
2. Line two: Customer Address (187 Desert Lane)
3. Line three: Width Length Minimum_Depth Maximum_Depth (15 30 8 12)
4. Line four: Tile_Code -->'T' for tile, 'E' for epoxy, 'H' for high gloss (T)

Sample Input for one job:
Too Hot Joe
187 Desert Lane
15 30 8 12
T

-------------------

* The output for each job should describe and echo the input and then present itemized costs and totals including the total labor cost and the total cost. It should also report the total volume of the pool and the total area of the pool walls. Indicate what backhoe is required.

Sample Output: (Calculated values may be incorrect)
Customer: Too Hot Joe
Address: 187 Desert Lane
Pool Dimensions: 30.0ft x 15.0ft x (8.0 to 12.0)ft deep
Pool Volume: 4500 Cubic Feet
Wall Surface: 1354 Square Feet
Backhoe Required: Arnold Super-Duper Backhoe
Backhoe Hours: 13 Hours
Equipment Cost: $ 7345.00
Operator Labor: $ 995.15
Tile Crew Hours: 10
Tile Crew Cost: $ 900.00
Total Labor: $ 1895.15
Total Equipment and Labor: $ 9240.15



I know I'm kinda asking a lot, but I'm stupid when it comes to putting this kind of stuff together. And I'm coming to you guys humbly and graciously asking for some guidance. But please just don't tell me I'm hopeless and retarded or that Im and jerk for asking so much. :-(

THANK YOU SO VERY MUCH TO ALL WHO EVEN RESPOND!!!

Jesse
Last edited on
I have never seen C++ before in my life [...]
http://www.cplusplus.com/doc/tutorial/
http://www.cplusplus.com/doc/tutorial/control/

That should be enough to get started. Try to do the assignment yourself, and if you get stuck, post the code and we will help.
Topic archived. No new replies allowed.