Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6. int main()
  7.  
  8. {
  9.     char code[5],pType[5],name[50],wifi[5],pName[50],wardName[10],patientType[15],wify[10];
  10.     int non,payment;
  11.    
  12.     cout << "Please enter your name : ";
  13.     cin.getline(pName,50);
  14.    
  15.     cout << "Please enter your the ward code (WC|WM) : ";
  16.     cin.getline(code,5);
  17.    
  18.     cout << "Type of patient(CN=Citizen|NCN=Non-Citizen) : ";
  19.     cin.getline(pType,5);
  20.    
  21.     cout << "Please enter number of night :  ";
  22.     cin >> non;
  23.    
  24.     cout << "Do you want to use the wifi?(Y=Yes|N=No) : ";
  25.     cin >> wifi;
  26.    
  27.     if(strcmp(code,"WC")==0)
  28.     {
  29.         strcpy(wardName,"Cempaka");
  30.        
  31.         if (strcmp(pType,"CN")==0)
  32.         {
  33.                 strcpy(patientType,"Citizen");
  34.                 payment=non*150.00;
  35.                
  36.                 if(wifi=="Y")
  37.                 {
  38.                     payment=payment+(50.00*non);
  39.                
  40.                 }
  41.                
  42.                
  43.         }
  44.    
  45.    
  46.         else if (strcmp(pType,"NCN")==0)
  47.         {
  48.             strcpy(patientType,"Non-Citezen");
  49.             payment=non*300.50;
  50.        
  51.             if(wifi=="Y");
  52.             {
  53.                 payment=payment+(65.00*non);
  54.             }
  55.         }
  56.    
  57.     else
  58.     {
  59.         payment=0;
  60.         strcpy(pType,"");
  61.     }
  62.    
  63.     }
  64.    
  65.     else if (strcmp(code,"WM")==0)
  66.     {
  67.         strcpy(wardName,"Melur");
  68.         if (strcmp(pType,"CN")==0)
  69.         {
  70.             strcpy(patientType,"Citizen");
  71.             payment=non*450.00;
  72.            
  73.             if(wifi=="Y")
  74.                 {
  75.                     payment=payment+(55.00*non);
  76.            
  77.                 }
  78.         }
  79.    
  80.    
  81.         else if (strcmp(pType,"NCN")==0)
  82.         {
  83.             strcpy(patientType,"Non-Citezen");
  84.             payment=non*600.00;
  85.        
  86.             if(wifi=="Y");
  87.             {
  88.                 payment=payment+(65.00*non);
  89.             }
  90.            
  91.         }
  92.        
  93.         else
  94.         {
  95.             payment=0;
  96.             strcpy(pType,"");
  97.         }
  98.    
  99.    
  100.  
  101.     }
  102.  
  103.  
  104.    
  105.     cout <<"\n\nPatient's Name: "<<pName<<endl;
  106.     cout <<"Type of patient: "<<patientType<<endl;
  107.     cout <<"Warc Code: "<<code<<endl;
  108.     cout <<"Ward Name: "<<wardName<<endl;
  109.     cout <<"WiFi: "<<wifi<<endl;
  110.     cout <<"Number of night: "<<non<<endl;
  111.     cout <<"Payment: " <<payment<<endl;
  112.    
  113.     getch();
  114.     return 0;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement