Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program should be written in C++ please. Create a program as follows: The program assists a shopkeeper in calculating the cost of a customers

The program should be written in C++ please.

Create a program as follows:

The program assists a shopkeeper in calculating the cost of a customers shoppingcart. The shop sells six items:

Asparagus

Brussels Sprouts

Corn

Lettuce

Pumpkins

Watermelons

When the program is run, it should first prompt the user for the number asparagus packages being purchased and accept input from the user with that number. The program should then prompt the user for the price of each asparagus package and accept input from the user with that number. Next, the program should do the same for Brussels sprouts. Then for corn, lettuce, pumpkins, and watermelon in turn.

After inputting the number of watermelons being purchased and the price of each watermelon, the program should display a summary describing the number of each vegetable and the price of each vegetable.

The program should then calculate and display a subtotal for the cost of all the vegetables being purchased.

The program should then calculate the sales tax on the vegetable purchase, assuming an 8.25% tax rate and print the tax.

Finally, the program should display a final total consisting of the sum of the subtotal and the tax.

In all cases, the costs should be displayed with two decimal places. In addition, the costs should all be aligned so the decimal points line up vertically. You can assume the cart will not contain more than 99 of any particular vegetable and you can assume that no vegetable purchase will total more than $999,999.99.

It's a relatively simple C++ program but I'm new to programming so a simple bug/syntax error takes me forever to figure out.

Please follow the instructions, I'm looking forward to rating you positively.

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

Students also viewed these Databases questions

Question

=+4. Prepare a balance sheet for Music Depot as of June 30, 2010.

Answered: 1 week ago

Question

Know the three main dimensions of the service environment.

Answered: 1 week ago