In: Computer Science
C++ application that calculates the sales at the end of the day. Need to know how much money I made on selling my famous banana muffins each day. At the end of each day I must not only enter the number of banana muffins I sold but I must also enter the price of the banana muffins. Each day I have to experiment with changing the price in an attempt to maximize my revenues for his muffins.
I also want to know how much money I made on my famous chocolate cake that I bake. I must enter the quantity and price for my chocolate cake as well.
I must also enter my gross sales amount at the end of the day and then do a calculation to determine the percentage of my revenues for banana muffins and the percentage of revenue for my chocolate cake.
C++ application
Solution:
#include<iostream>
using namespace std;
int main()
{
   float bm,pbm,fc,pfc,perm,perc,gross;
  
   cout<<"Enter the number of banana muffins
sold:";
   cin>>bm;
   cout<<"Enter price of a banana muffin:";
   cin>>pbm;
   cout<<"Enter the quantity of famous chocolate
cake sold:";
   cin>>fc;  
   cout<<"Enter price for a chocolate cake:";
   cin>>pfc;
   cout<<"Enter your gross sales amount:";
   cin>>gross;
   perm=((bm*pbm)/gross)*100;
   perc=((fc*pfc)/gross)*100;
   cout<<"Percentage of revenue for banana muffin
is "<<perm<<" %\n";
   cout<<"Percentage of revenue for chocolate cake
is "<<perc<<" %\n";
   return 0;
}
Output:
