#include<bits/stdc++.h>
using namespace std;
int main()
{
char nm[30];
string st;
int n,status,preference;
float Discount,payment,Price;
cout<<"Enter your name ";
cin>>nm;
cout<<"\nEnter patient status\n1. Adult\n2. Child\n";
cin>>status;
switch(status)
{
case 1: st="Adult";
break;
case 2: st="Child";
break;
default: cout<<"Invalid Status!!!";
}
cout<<"\nEnter preferred type of treatment\n1. Restoration\n2. Extraction\n3. Scaling\n";
cin>>preference;
switch(preference)
{
case 1: if(status==1)
{
Price=7.50;
Discount=7.50*0.15;
payment=7.50-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
if(status==2)
{
Price=6.00;
Discount=6.00*0.20;
payment=6.00-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
break;
case 2: if(status==1)
{
Price=18.00;
Discount=18.00*0.15;
payment=18.00-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
if(status==2)
{
Price=15.50;
Discount=15.50*0.20;
payment=15.50-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
break;
case 3: if(status==1)
{
Price=5.00;
Discount=5.00*0.15;
payment=5.00-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
if(status==2)
{
Price=4.00;
Discount=4.00*0.20;
payment=4.00-Discount;
cout<<"\nPatient Name: "<<nm<<"\nStatus: "<<st<<"\nPrice = RM"<<Price<<"\nDiscout = RM"<<Discount<<"\nTotal Payment = RM"<<payment;
}
break;
default: cout<<"Invalid Input!!!";
}
}
Comments
Leave a comment