Answered step by step
Verified Expert Solution
Link Copied!

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

student submitted image, transcription available below  

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Management Managing Across Borders And Cultures

Authors: Helen Deresky

10th Global Edition

1292430362, 978-1292430362

More Books

Students also viewed these Programming questions

Question

What are the assumptions of a logistic regression model?

Answered: 1 week ago

Question

How can e-commerce aid strategy implementation?

Answered: 1 week ago