Question

In: Computer Science

use C++ . Compute the total cost of a meal inclusive of GST (Goods and Service...

use C++

. Compute the total cost of a meal inclusive of GST (Goods and Service Tax) and tipping. Assume that the GST is fixed at 6% but the amount to tip will depend on the customer. Your program should input the cost of the meal (before GST and tipping) and the tip amount (to be input as a percentage). Your program should display: - The total cost of the meal BEFORE GST and tipping - The total cost of the meal AFTER GST - The total cost of the meal AFTER GST and tipping

Solutions

Expert Solution

main.cpp

#include <iostream>

using namespace std;

int main()
{
double meal_cost, GST=6, tip, total_cost;
  
cout<<"Enter the cost of the meal: ";
cin>>meal_cost;
  
cout<<"Enter the tip amount (in percentage): ";
cin>>tip;
  
cout<<"The total cost of the meal before GST and tipping = "<<meal_cost<<endl;
  
//calculating total cost after GST
total_cost = meal_cost + meal_cost*6/100;
cout<<"The total cost of the meal after GST = "<<total_cost<<endl;
  
//calculating total cost after GST and tip
total_cost+= meal_cost*tip/100;
cout<<"The total cost of the meal after GST and tipping = "<<total_cost<<endl;
  
return 0;
}

Code Snippet (For Indentation):

Output:


Related Solutions

Use the format in Exhibit 9-1 to compute the ending FIFO inventory and cost of goods...
Use the format in Exhibit 9-1 to compute the ending FIFO inventory and cost of goods sold assuming: $600,000 in sales Beginning inventory 1125 units @ $175 Purchases of 890 units @ $150 450 units @ $165 200 units @ $140 Ending inventory 845 units Using the FIFO method, what is the cost of goods sold percentage of sales? Use the format in Exhibit 9-1 to compute the ending FIFO inventory and cost of goods sold assuming: $560,000 in sales...
Use the following information to compute the cost of goods manufactured. Assume that all raw materials...
Use the following information to compute the cost of goods manufactured. Assume that all raw materials used were traceable to specific units of product:    Beginning raw materials $ 5,500 Ending raw materials 4,000 Direct labor 12,250 Raw material purchases 7,400 Depreciation on factory equipment 6,500 Factory repairs and maintenance 3,300 Beginning finished goods inventory 10,200 Ending finished goods inventory 8,900 Beginning work in process inventory 5,700 Ending work in process inventory 6,300 $31,650. $30,650. $36,650. $30,950. $30,350.
Use the Following Information to Compute the Ratios Below Cost of Goods Sold for 12-31-2014 =...
Use the Following Information to Compute the Ratios Below Cost of Goods Sold for 12-31-2014 = 750,000 Cost of Goods Sold for 12-31-2013 = 900,000 Ending Inventory 12-31-2014 = 75,000 Ending Inventory 12-31-2013 = 25,000 Sales Revenues 12-31-2014 = $1,000,000 Sales Revenues 12-31-2013 =$1,500,000 Inventory Turnover Ratio = COGS / Average Inventory Days-in-Inventory = 365/ Inventory Turnover Ratio Compute the Inventory Turnover Ratio for Year Ended 12-31-2014 Compute the Days In Inventory for the Year Ended 12-31-2014 NEXT QUESTION Which...
Compute ending inventory, cost of goods sold, and gross profit.
My question: Assume the company uses three inventory pools instead of one. Compute ending inventory, cost of goods sold, and gross profit. (Round price index to 2 decimal places, e.g. 1.45 and final answers to 0 decimal places, e.g. 6,548.)   William’s Televisions produces television sets in three categories: portable, midsize, and flat-screen. On January 1, 2020, William adopted dollar-value LIFO and decided to use a single inventory pool. The company’s January 1 inventory consists of: Category   Quantity  ...
Which of the following lists of items is used to compute the cost of goods available...
Which of the following lists of items is used to compute the cost of goods available for sale? a.Sales, beginning inventory, and ending inventory b.Gross profit, beginning inventory, and ending inventory c.Beginning inventory and ending inventory d.Net sales, beginning inventory, and ending inventory e.Delivered cost of purchases and beginning inventory
Briefly explain the following terms: (a) Service cost (b) Interest cost (c) Prior service cost (d)...
Briefly explain the following terms: (a) Service cost (b) Interest cost (c) Prior service cost (d) Vested benefits
Compute the cost per equivalent unit for materials, for labour, for overhead, and in total.
Ainsley Industries uses the weighted-average method in its process costing system. Data for the Assembly Department for May appear below:     Materials Labour Overhead Work in process, May 1 $28,000 $22,000 $117,500 Cost added during May $52,000 $18,500 $63,600 Equivalent units of production 1,500 800 1,200   Required Compute the cost per equivalent unit for materials, for labour, for overhead, and in total.
IN C++ Modify the above program to compute the side area, total area, and volume of...
IN C++ Modify the above program to compute the side area, total area, and volume of a cylinder and the area and volume of a sphere, depending on the choice that the user makes. Your program should ask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" for other values. For a cylinder, we want to compute: Side area: (2*PI*r) * h Total Area: 2*(PI*r2) + Side area Volume: (PI*r2)*h For a...
In this make or buy problem, you should compute the total cost of making a particular...
In this make or buy problem, you should compute the total cost of making a particular part and the total costs of buying the same part. Try following the solutions steps: Determine the parameters of the make cost function - the variable costs per unit and the fixed costs. Determine the fixed costs that are avoidable and the fixed costs that are unavoidable. Determine the buy price. Determine the alternative use of the idle resources under the buy, Note that...
In this make or buy problem, you should compute the total cost of making a particular...
In this make or buy problem, you should compute the total cost of making a particular part and the total costs of buying the same part. Try following the solutions steps: Determine the parameters of the make cost function - the variable costs per unit and the fixed costs. Determine the fixed costs that are avoidable and the fixed costs that are unavoidable. Determine the buy price. Determine the alternative use of the idle resources under the buy, Note that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT