Question

Total Purchase (5 pt) A customer in a store is purchasing five items. The prices of...

Total Purchase (5 pt)

A customer in a store is purchasing five items. The prices of the five items are:

price of item 1 = $15.95

price of item 2 = $24.95

price of item 3 = $6.95

price of item 4 = $12.95

price of item 5 = $3.95

Write a program that holds the prices of the five items in five variables. Display

each item’s price,
the subtotal of the sale (total price of five items without tax),
the amount of sales tax,
the total.
Assume the sales tax is 7%, define it as a named constant in your program.


c++

Homework Answers

Answer #1

code:

#include <bits/stdc++.h>
using namespace std;
int main()
{
double item1=15.95, item2=24.95, item3=6.95, item4=12.95, item5=3.95; //storing 5 items.
double subtotal, tax, total;

//printing the item prices.
cout << "Price of item 1 = $" << item1 << endl;
cout << "Price of item 2 = $" << item2 << endl;
cout << "Price of item 3 = $" << item3 << endl;
cout << "Price of item 4 = $" << item4 << endl;
cout << "Price of item 5 = $" << item5 << endl;

subtotal = item1+item2+item3+item4+item5; //calculating total without tax of 5 items.
cout << "\nSubtotal of the sale = $" << subtotal << endl; //printing subtotal

tax = (subtotal*7)/100; //calculating 7% tax.
cout << "\nThe amount of sales tax = $" << tax << endl; //printing tax.

total = subtotal+tax; //calculating total.
cout << "\nThe total amount = $" << total << endl; //printing the total of 5 items.
return 0;
}

output:

Note: my friend if you have any questions or queries comment below. Thank you my friend.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
C ++ program that will read in prices and store them into a two-dimensional array //...
C ++ program that will read in prices and store them into a two-dimensional array // It will print those prices in a table form and the lowest price. // EXAMPLE // Input: // Please input the number of rows from 1 to 10 // 2 // Please input the number of columns from 1 to 10 // 3 // // Input price of item (0,0): 2 // Input price of item (0,1): 4 // Input price of item (0,2):...
(Calculating Sales) An online retailer sells five products whose retail prices are as follows: Product 1,...
(Calculating Sales) An online retailer sells five products whose retail prices are as follows: Product 1, $$2.98; Product 2, $4.50; Product 3, $9.98; Product 4, $4.49, and Product 5, $6.87. Write an application that reads a series of pairs of numbers s follows: a) product number b) quanity sold Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled...
JAVA public class Purchase { private String name; private int groupCount; //Part of price, like the...
JAVA public class Purchase { private String name; private int groupCount; //Part of price, like the 2 in 2 for $1.99. private double groupPrice; //Part of price, like the $1.99 in 2 for $1.99. private int numberBought; //Total number being purchased. public Purchase () { name = "no name"; groupCount = 0; groupPrice = 0; numberBought = 0; } public Purchase (String name, int groupCount, double groupPrice, int numberBought) { this.name = name; this.groupCount = groupCount; this.groupPrice = groupPrice; this.numberBought...
      MK Restaurant: Branding of Thai-Style Hotpot The restaurant industry is one of the most...
      MK Restaurant: Branding of Thai-Style Hotpot The restaurant industry is one of the most competitive in Thailand. With a large number of players ranging from restaurants in five-star hotels, global fast-food chains to small stalls along the streets and everything in between, the Thais are spoiled for choice. In addition, as the world becomes globalized, consumers are familiar with international dishes and would not hesitate to try new offerings from the other side of the globe. As a...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT