I need the output to have the decimal points lined up for any test data I decide to use. How could I do that in this code?. (The computer language that I am using is c++) #include #include //Define...


I need the output to have the decimal points lined up for any test data I decide to use. How could I do that in this code?. (The computer language that I am using is c++)


#include


#include


//Define constant for tax rate

#define taxRate 0.0788

using namespace std;

int main()

{

//Set the precision to two decimal places

cout <>

const double EXT_MONITOR=159.99;

const double DELL_KEYB=18.30;

const double DELL_MOUSE=16.45;

const double WIND_OS=199.99;

const double PRINTER=599.89;

int extMonitor,d_keyboards,d_mouse,wind_OS,printer;

double costEMonitor,costDell_key,cost_d_mouse,costWindOs,costPrinter;

double total=0,subtotal,tax;

//Get the required inputs from the user

cout<"how>

cin>>extMonitor;

cout<"how>

cin>>d_keyboards;

cout<"how>

cin>>d_mouse;

cout<"how>

cin>>wind_OS;

cout<"how>

cin>>printer;

//Compute cost for external monitor

costEMonitor=EXT_MONITOR*extMonitor;

//Compute cost for dell mouse

cost_d_mouse=DELL_MOUSE*d_mouse;

//Compute cost for dell keyboard

costDell_key=DELL_KEYB*d_keyboards;

//Compute cost for windows OS

costWindOs=WIND_OS*wind_OS;

//Compute cost for printer

costPrinter=PRINTER*printer;

//Compute cost for sub total

subtotal=costEMonitor+costDell_key+cost_d_mouse+costPrinter+costWindOs;

//Print the output

cout<"\nqty>

cout<">

cout<"><>

cout<"><>

cout<"><>

cout<"><>

cout

//Compute tax

tax=subtotal*taxRate;

//Compute total

total=subtotal+tax;

cout

cout


return 0;

}





May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here