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.
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; }
Comments
Leave a comment