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.0788using namespace std;int main(){//Set the precision to two decimal placescout <>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 usercout<"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 monitorcostEMonitor=EXT_MONITOR*extMonitor;//Compute cost for dell mousecost_d_mouse=DELL_MOUSE*d_mouse;//Compute cost for dell keyboardcostDell_key=DELL_KEYB*d_keyboards;//Compute cost for windows OScostWindOs=WIND_OS*wind_OS;//Compute cost for printercostPrinter=PRINTER*printer;//Compute cost for sub totalsubtotal=costEMonitor+costDell_key+cost_d_mouse+costPrinter+costWindOs;//Print the outputcout<"\nqty>cout<">cout<"><>cout<"><>cout<"><>cout<"><>cout//Compute taxtax=subtotal*taxRate;//Compute totaltotal=subtotal+tax;coutcout
return 0;}
">">">">">"\nqty>"how>"how>"how>"how>"how>
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here