Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Make a program that will find the cost of foods that soldiers in world war 2 commonly ate on a regular daily basis.

In C++

Make a program that will find the cost of foods that soldiers in world war 2 commonly ate on a regular daily basis. One soldier will have an order of a specific amount of different things that they ate, and you will have a fixed cost for each of the 10 items. For context; one soldier can order however many things from the list.

Items and their fixed cost:

Meat: $2.30

Eggs: $3.00

Biscuits: $2.50

Compressed Cereal: $5.00

Fruit Bar: $6.70

Instant Coffee: $2.00

Spread Cheese: $4.00

Drink Mix: $0.75

Candy Bar: $1.75

Chewing Gum: $1.25

Context: One Soldier can order however many things they want, they might not order somethings, they might order a couple of 1 item, they might order a couple of the ten different things listed so you need to be able to have a program that will output the cost of not only the order and the amount of what is being multiplied by that item and the cost, but the final cost as well. I will give you an example order.

Output: Everything below shown on screen

What is the soldier's order? (asks for input)

(Input:)

Meat: 2 portions of meat

Eggs: 2 eggs

Biscuits: 4 biscuits

Compressed Cereal: 1 compressed cereal

Fruit Bar: 14 fruit bars

Instant Coffee: 1 instant coffee

Spread Cheese: 0 spread cheese

Drink Mix: 0 drink mix

Candy Bar: 3 candy bars.

Chewing Gum: 1 pack of chewing gum.

Proof of Calculation:

Meat: $2.30 x 2 = $4.60

Eggs: $3.00 x 2 = $6.00

Biscuits: $2.50 x 4 = $10.00

Compressed Cereal: $5.00 x 4 = $20.00

Fruit Bar: $6.70 x 14 = $93.80

Instant Coffee: $2.00 x 1 = $2.00

Spread Cheese: 0 (did not order any of this item)

Drink Mix: 0 (did not order any of this item)

Candy Bar: $1.75 x 3 = $5.25

Chewing Gum: $1.25 x 1 = $1.25

Final Cost = $142.90

Thank you I will leave a comment and give 5 star rating :) much appreciated.

You can be advanced, PLS WRITE CLEAN CODE (use arrays, vectors, or files if they apply here)

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

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

Describe the Indian constitution and political system.

Answered: 1 week ago

Question

Explain in detail the developing and developed economy of India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = X 52+7 - 1)(x+2) dx

Answered: 1 week ago

Question

What is gravity?

Answered: 1 week ago

Question

What is the Big Bang Theory?

Answered: 1 week ago

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago