Answer to Question #5713 in C++ for haruna

Question #5713
write a program that computes the amount of money COSSA will receive from the proceed of their candy sale project. they sold 37 cases, which had 12 bars per case. the candy was sold for ghc 0.75 per bar. each case cost ghc 5.00. they are required to give the SRC 10% of their earnings. display their proceeds.
1
Expert's answer
2011-12-20T09:42:38-0500
#include <cstdlib>
#include <iostream>
#include <iomanip>

using namespace std;

int main(int argc, char *argv[])
{
int cases=37;
int bars_per_case=12;
double sell_price=0.75;
double case_price=5.00;
double src_tax=0.1;
cout<<"37 cases for ghc 5.00 per item cost ghc ";
double all_cases=cases*case_price;
cout<<fixed<<setprecision(2)<<all_cases<<endl;
cout<<"Total amount of candies they sold is ";
int all_candy=cases*bars_per_case;
cout<<all_candy<<endl;
cout<<"They totally earned ghc ";
double earn=all_candy*sell_price;
cout<<earn<<endl;
cout<<"From this amount they gave ghc ";
double gave=earn*src_tax;
cout<<gave<<" to SRC"<<endl;
cout<<"So, after sll transactions they have ghc ";
double total=earn-gave;
cout<<total<<endl;
cout<<"After excluding the cost of cases, which they bought before, the total amount they have earned is ";
cout<<total-all_cases<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS