Question: Fix this code //----------------------------------------------------------------------------- //Programmer's Name: //Program: Exercise 2 // Description (IPO): // Assign sales tax rate // Assign markup percent // Initialize the accumulators

Fix this code

//-----------------------------------------------------------------------------

//Programmer's Name:

//Program: Exercise 2 //

Description (IPO):

// Assign sales tax rate

// Assign markup percent

// Initialize the accumulators to 0 /

/ Initialize item number to 0

// For each item

// Input the original price from the keyboard

// Increment item number by 1

// Calculate the markup amount for this item

// Calculate the selling price for this item

// Calculate the sales tax for this item

// Calculate the final price for this item

// Accumulate this item's sales tax into the total tax

// Accumulate this item's final price into the final cost

// Output this item's assigned & calculated values to the screen

// Output total tax to the screen // Output total final cost to the screen

//----------------------------------------------------------------------------- Program Requirements:

Use the course rules for blocking the code, constant names and variable names

increment item number for each item Use accumulators for the total sales tax and total final cost

set for floating point values appropriately to 2 or 3 as needed for the output

Output all data to the screen formatted using setw to align

Output a divider to the screen to separate items & totals using setw

Comment the code using the keywords

Do Not submit with any Warnings or Errors!

*****To make a profit, a local store marks up prices of items by a certain percentage. Write a C++ program that inputs the original price of an item 1 and original price of item 2 from the user. Assign a value of 50% for the markup percent and assign 8.5% for the sales tax rate. For each item, Calculate the markup amount, the tax, the selling price (before tax), and the final price (includes tax). You must use the same variable names for the first and second item

------------------------------------------------------------------------------------------------------------------------------------------

//Program: Exercise 2 //Grade: //Comments: //Description (IPO): // //Input: 2 original prices // //Process: Calculate markup amount, selling price, tax, and final price for each item, accumulate total tax and final cost // //Output: Assigned & calculated values, total tax, total final cost //------------------------------------------------------------

//Include - to use input & output on the screen #include

//Include - to use string variables #include

//Include - to use input & Output Manipulators #include

/amespace using statement must be included to use the standard header files using namespace std;

//Constants const string MY_PROGRAM = "Exercise 2"; const string MY_NAME = "Tazrian Rahman Chowdhury";

const double MARKUP_PERCENT = 0.50; const double SALES_TAX_RATE = 0.085;

const int SCREEN_WIDTH = 90; const char SYMBOL = '*';

int main(void) { int itemNumber;

double originalPrice; double markupAmount; double sellingPrice; double tax; double finalPrice; double totalSalesTax = 0; double totalFinalCost = 0;

//Initialize item number itemNumber = 0;

//Initialize accumulators totalSalesTax = 0.0; totalFinalCost = 0.0;

//Output the haeading to the screen cout

//Set all output of floating point numbers on the screen to fixed with precision of 3 cout

//--------------------------------------item 1------------------------------ //Input original prices from the user cout > originalPrice; cout

//Increment item number itemNumber++;

//Calculate for markupAmount, sellingPrice,tax, finalPrice

markupAmount = originalPrice * MARKUP_PERCENT; sellingPrice = originalPrice + markupAmount; tax = sellingPrice * SALES_TAX_RATE; finalPrice = sellingPrice + tax;

// Calculate the total sales tax and final cost totalSalesTax = tax; totalFinalCost = finalPrice;

//Output the data to the screen cout

//Output a divider to the screen cout

//--------------------------------------item 2------------------------------- cout > originalPrice; cout

//Increment item number itemNumber++;

//Calculate for markupAmount, sellingPrice,tax, finalPrice markupAmount = originalPrice * MARKUP_PERCENT; sellingPrice = originalPrice + markupAmount; tax = sellingPrice * SALES_TAX_RATE; finalPrice = sellingPrice + tax;

// Calculate the total sales tax and final cost totalSalesTax = tax; totalFinalCost = finalPrice;

//Output the data to the screen cout

//Output a divider to the screen cout

cout

return 0;

}

 Fix this code //----------------------------------------------------------------------------- //Programmer's Name: //Program: Exercise 2 // Description

Enter the original price: 12.35 The markup percent: 0.50 The markup amount: 6.17 Thesalestaxrate:Thesellingprice:0.08518.52 Thetax:Thefinalprice:1.5720.10 Enter the original price: 17.50 Item Number: The original price: The markup percent: The markup amount: 8.75 The sales tax rate: 0.085 The selling price: 26.25 \begin{tabular}{lr} The tax: \\ The final price: & 2.23 \\ \hline \end{tabular} The total sales tax for both purchases is: The total final cost for both purchases is: 48.81 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!