Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <conio.h>
- using namespace std;
- int main()
- {
- char code[5],pType[5],name[50],wifi[5],pName[50],wardName[10],patientType[15],wify[10];
- int non,payment;
- cout << "Please enter your name : ";
- cin.getline(pName,50);
- cout << "Please enter your the ward code (WC|WM) : ";
- cin.getline(code,5);
- cout << "Type of patient(CN=Citizen|NCN=Non-Citizen) : ";
- cin.getline(pType,5);
- cout << "Please enter number of night : ";
- cin >> non;
- cout << "Do you want to use the wifi?(Y=Yes|N=No) : ";
- cin >> wifi;
- if(strcmp(code,"WC")==0)
- {
- strcpy(wardName,"Cempaka");
- if (strcmp(pType,"CN")==0)
- {
- strcpy(patientType,"Citizen");
- payment=non*150.00;
- if(wifi=="Y")
- {
- payment=payment+(50.00*non);
- }
- }
- else if (strcmp(pType,"NCN")==0)
- {
- strcpy(patientType,"Non-Citezen");
- payment=non*300.50;
- if(wifi=="Y");
- {
- payment=payment+(65.00*non);
- }
- }
- else
- {
- payment=0;
- strcpy(pType,"");
- }
- }
- else if (strcmp(code,"WM")==0)
- {
- strcpy(wardName,"Melur");
- if (strcmp(pType,"CN")==0)
- {
- strcpy(patientType,"Citizen");
- payment=non*450.00;
- if(wifi=="Y")
- {
- payment=payment+(55.00*non);
- }
- }
- else if (strcmp(pType,"NCN")==0)
- {
- strcpy(patientType,"Non-Citezen");
- payment=non*600.00;
- if(wifi=="Y");
- {
- payment=payment+(65.00*non);
- }
- }
- else
- {
- payment=0;
- strcpy(pType,"");
- }
- }
- cout <<"\n\nPatient's Name: "<<pName<<endl;
- cout <<"Type of patient: "<<patientType<<endl;
- cout <<"Warc Code: "<<code<<endl;
- cout <<"Ward Name: "<<wardName<<endl;
- cout <<"WiFi: "<<wifi<<endl;
- cout <<"Number of night: "<<non<<endl;
- cout <<"Payment: " <<payment<<endl;
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement