Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is in C++ Not gonna lie this seemed kind of simple when I was reading it, but then I found myself stuck at the
This is in C++
Not gonna lie this seemed kind of simple when I was reading it, but then I found myself stuck at the point where I was trying to figure out how to use the if statement to make it so that I can make the program identify when boxes and/or packages are needed based on the input of engines. Thank you so much to whoever my savior is for this, cause I feel like I lost my mind trying to put it all together
2.Calculate Engine Purchase Model rocket engines are generally purchases in boxes of 24 or packages of 3. If I want 32 engines I would need to purchase 1 box of 24 and 3 packages of 3 (I would end up with 1 extra engine). Write a program that calculates how many boxes and packages you must purchase to get a specific number of engines. Also enter the price of a box and a package and calculate the total cost of the purchase. Use integer division (/, %) to calculate the number of boxes and packages. Note: when printing out the answer the correct word (box/boxes, package/packages) should appear after the number. If the number is 0, don't print anything at all. Example Output: Enter the number of engines needed: 30 Enter the cost of a box of 24 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. Enter the number of engines needed: 10 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 4 packages of engines
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started