c++ dental application - /*Fanny Y. Student. Cmpsc 101....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
and specify which services were performed during the visit.*/ #include<iostream> #include<iomanip> #include<string> using namespace std int main() { string patientName char choice const double clean = 35, xray = 85, cavity = 150 double totalBill = 0 cout<<"AVAILABLE SERVICES: "<<endl cout<<"-------------------------------"<<endl cout<<setprecision(2)<<showpoint<<fixed cout<<"1 Cleaning"<<setw(12)<<"$35"<<endl cout<<"2 X-ray"<<setw(15)<<"$85"<<endl cout<<"3 Fill A Cavity"<<setw(8)<<"$150"<<endl<<endl cout<<"Enter patient's full name: " getline(cin, patientName) if(patientName == "") cout<<"You did not enter a patient's name. "<<endl else { cout<<"Which service(s) were performed on "<<patientName<<"? "<<endl cout<<"Enter Y for yes or N for no. "<<endl cout<<"Cleaning? " cin>>choice if(choice == 'y' || choice == 'Y') totalBill = clean + totalBill cout<<"X-ray? " cin>>choice if(choice == 'y' || choice == 'Y') totalBill = xray + totalBill cout<<"Fill a cavity? " cin>>choice if(choice == 'y' || choice == 'Y') totalBill = cavity + totalBill cout<<endl<<endl if(totalBill == clean) { cout<<"RESULTS: "<<endl cout<<"Patient Name: "<<patientName<<endl Page 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/18/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Fall '07 term at Pennsylvania State University, University Park.

Page1 / 6

c++ dental application - /*Fanny Y. Student. Cmpsc 101....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online