# Calculating Engine Purchase

• 02-21-2013
nomihc36
Calculating Engine Purchase
Hi guys, I am a complete noob when it comes to programming and I have to take this programming class to be able graduate this year.

I have to write a program that calculates how many boxes and packages one must purchase to get a specific number of engines. The number of engines needed, the cost of a box, and the cost of a package are entered by the user. One box contains 25 engines, and one package contains 3 engines.

Here is an example output provided by our teacher:

Enter the number of engines needed: 30
Enter the cost of a box of 25 engines: 65.95
Enter the cost of a package of 3 engines: 8.49

You will need to purchase 1 box and 2 packages of engines at a total cost of \$82.93. (program ends)

I'd like to note that costs of the box and packages are the same for each test case we have to do. Also, when printing out the answer the correct word (box/boxes, package/packages) should appear after the number. And if the number is 0, nothing should be printed.

I understand how to do the calculations to find out the numbers required, and that I have to use if/else if statements to make the correct word appear after the number. The problem is I have no idea how to make the number appear in the output statement. Also, all the calculated numbers are supposed to be integers.

Please help if any of this makes sense to you. If you need more clarification, I'd be happy to do so.

Thank you in advance
:D
• 02-21-2013
std10093
So, what's the problem? Can't you be more specific than just copy-pasting your exercise?

-- by GReaper, the Spartan :P