help with my code for tax rate and mark up

i am having trouble with my code i am writing code for calculating the tax rate and mark up percentage of items in a store and i entered a double variable for the original price at 100 and when it was all calculated it didnt set it equal to 100
i know i prolly worded this bad but heres my code so u can see what im talking about
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

const string MY_NAME = "Taren Davis";

const string MY_ASSIGNMENT = "Exercise 2";

const int SCREEN_WIDTH = 70;

int main(void)
{
double originalPrice;
double percentOfMarkedUpPrice;
double markedUpPrice;
double salesTaxRate;
double sellingPrice;
double salesTax;
double finalPrice;
int itemNum;

cout << setprecision(2);

cout << setfill('*');

cout << setw(SCREEN_WIDTH+1) << " " <<endl;
cout << setfill(' ');
cout << MY_NAME << endl;
cout << MY_ASSIGNMENT << endl;

itemNum = 0;

// -------Start of first item's calculations--------------------------------------
cout << setfill('*');

cout << setw(SCREEN_WIDTH+1) << " " <<endl;
cout << setfill(' ');

itemNum += 1;

originalPrice = 100.00;
percentOfMarkedUpPrice = 0.25;
salesTaxRate = 0.08;

markedUpPrice = originalPrice * percentOfMarkedUpPrice;
sellingPrice = originalPrice + markedUpPrice;
salesTax = sellingPrice * salesTaxRate;
finalPrice = sellingPrice + salesTax;

cout << " Item Number: " << setw(19) << itemNum << endl;
cout << " The Original Price: " << setw(6) << originalPrice << endl;
cout << " The Markup Percent: " << setw(12) << percentOfMarkedUpPrice << endl;
cout << " The Sales Tax Rate: " << setw(12) << salesTaxRate << endl;
cout << " The Selling Price: " << setw(12) << sellingPrice << endl;
cout << " The Tax: " << setw(12) << salesTax << endl;
cout << " The Final Price: " << setw(12) << endl;
cout << setw(SCREEN_WIDTH+1) << " " << endl;

return (0);
}
Topic archived. No new replies allowed.