I need some help on a problem...
Printable View
I need some help on a problem...
sorry dude, I never did have much rhythm
Wow, jd.
Depends on what you mean, hang.
problem:Quote:
....problem is
Dunno about the programming part but the formula for calculating the price could look something like this:
Variables:
Code:Name: Value: Abbreviation:
750+ square inches 1/0 A
Mahogany 1/0 B
Oak 1/0 C
Cherry 1/0 D
Pine 1/0 E
Drawers 0 to infinite F
Code:175+(A*75)+(B*200)+(C*150)+(D*100)+(E*0)+(F*35)=Price of the desk
EDIT: The text is jumping around like crazy but you get the idea.
EDIT 2: Changed the drawers value range from "1-infinite" to "0-infinite" as NightrainSrt4 suggested.
I didn't read the assignment properly :P
Diamon has it well laid out. But change the 1 in Drawers to be 0, as you can have 0 drawers in the desk. You would initialize everything to zero, and only change the values of the variables the user specifies.
Your instructor should have explained how he wanted the program plan, introduction, etc, as that is the Software Engineering part of the problem, and I'm sure he/she has specific requirements/method of teaching you.
Its an online class with zero direction thanks For the help.
Or, alternately:
Variables:
Code:Name: Value: Abbreviation:
750+ square inches 1/0 A
WoodType 0/100/150/200 B
Drawers 0 to infinite F
Single bigger variable instead of four smaller ones, more complicated code when assigning values, but simpler algorithm when finding end price. It all depends on what is more important in the specific circumstance.Code:175+(A*75)+B+(F*35)=Price of the desk
Also, as a side note, that's an absurd pricing criteria. :P (I know, you didn't make it up. Still, it had to be said.)
what should the program plan consist of? Just an explanation of how this algorithm works?
I would usually just explain what the variables mean in my programs,
however writing a field stating where the algo starts and a small explanation shouldn't hurt.