Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using c++ Language ALGORITHNIC LOGIC FORMULATION 8Asiaclean Corp. gives commissi

ID: 3868502 • Letter: U

Question

Using c++ Language


ALGORITHNIC LOGIC FORMULATION 8Asiaclean Corp. gives commissions to its salesmen depend inq on the type of. product sold as well as the sales amount as follows: Product Type Product code commission Vacuum Cleaner Water Purifier 12% of sales amount ; P250 regardless of sales amount 10% of sales amount or P400 whichever is lower 15% of sales amount or P950 whichever is higher VC WP FP WT Floor Polisher Water Tank Waite a progran that vould input the product code and che sales amount and then output the corresponding commission ut the product code and the

Explanation / Answer

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
class sales
{
public: //variable declaration
string pc,pn;
double sa,comm,t;
void calc()
{
cout<<"Enter the product code : "; //accepting the prodcut code from user
cin>>pc;
cout<<endl;
cout<<"Enter the Sales Amount : "; //accepting the total sales amount from user
cin>>sa;
cout<<endl;
if(pc=="VC") //calculating the commission according teo the prodcut code
comm=0.12*sa;
else if(pc=="WP")
comm=250;
else if(pc=="FP")
{
t=0.1*sa;
if(t<400)
comm=t;
else
comm=400;
}
else if(pc=="WT")
{
t=0.15*sa;
if(t>950)
comm=t;
else
comm=950;
}
else
{
cout<<"Invalid Product Code";
exit(0);
}
}
void display()
{
if(pc=="VC")
pn="Vaccum Cleaner";
else if(pc=="WP")
pn="Water Purifier";
else if(pc=="FP")
pn="Floor Polisher";
else
pn="Water Tank"; //printing the details
cout<<"Product Name : "<<pn<<endl;
cout<<"Product Code : "<<pc<<endl;
cout<<"Commission :Rs "<<comm<<endl;
}
};
  
int main()
{
sales obj; //object of the class
obj.calc(); //calling the calc function
obj.display(); //calling the display funciton
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote