Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h> //functions involving memory allocation, process control, conversions
- #include <string>
- #include <sstream> // Strings are used for storing a text
- #include <fstream> // it can create files, write information to files, and read information from files
- #include <ctime>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <cerrno>
- using namespace std;
- string option, name, id_no, phone_no;
- void print_bill(float bill)
- {
- string p_option;
- cout << "\n Welcome to Billing Deparment \n\n" << endl;
- cout << " ---------------Receipt---------------\n\n" << endl;
- cout << " ***************************************" << endl;
- cout << " Name:" << name;
- cout << " \tId card number:" << id_no << endl;
- cout << " Phone no:" << phone_no << endl;
- cout << " ***************************************\n" << endl;
- cout << " ***************************************" << endl;
- cout << " Service charge\t\t\t"<< bill << endl;
- cout << " TAX \t\t\t"<< bill*10/100 << endl;
- cout << " ***************************************" << endl;
- cout << " Total Bill \t\t\t" << bill + (bill * 10 / 100) << endl;
- cout << " ***************************************" << endl;
- system("pause");
- system("cls");
- cout << " Pay Bill \n\n" << endl;
- cout << " Do you want to pay with cash or card ? "<< endl;
- cout << " [1] - Card " << endl;
- cout << " [2] - Cash " << endl;
- cout << " [3] - e-wallet " << endl;
- cout << "\n Select your payment types ";
- cin>>p_option;
- if (p_option == "1")
- {
- string card_no = "";
- do {
- cout << "\n Please Insert your Card Numbers ";
- cin >> card_no;
- }while (card_no.length()!=16); //bool isvalid = check_valid(card_no);
- cout << "\n Thank You, we have received your payment. ";
- }
- if (p_option == "2")
- {
- cout << "\n Please Submit Your Cash \n";
- cout << "\n Thank you for your payment ";
- }
- if (p_option == "3")
- {
- cout << "\n We have connected with your E-Wallet Apps \n";
- string wallet_name;
- getline(cin, wallet_name);
- cout << "\n Thank You, your transaction is successful. ";
- }
- }
- int main() {
- /* Display the title of the program */
- system("color 0");
- //system("pause");
- system("cls");
- int bill[10];
- float total_bill=0.0F;
- system("color 0");
- cout << endl;
- cout << " Welcome to The Hospital \n\n\n\n" << endl;
- cout << " Please Fill The Information Details \n"; //save a string
- cout << "\t\tName: " ;
- getline(cin, name);
- cout << endl;
- again:
- cout << "\t\tIC Numbers: ";
- getline(cin, id_no);
- cout << endl;
- cout << "\t\tPhone Numbers: ";
- getline(cin, phone_no);
- if (id_no.length() != 12 || phone_no.length() != 10)
- {
- cout << "Make Sure You Enter The Correct Number!" << endl;
- cout << "Please Enter Again: " << endl;
- goto again;
- }
- system("cls");
- /* Display the MENU */
- menu:
- cout << " " << endl; //spacing
- cout << " Choose our Service \n"; //save a string
- cout << " " << endl;
- cout << " [1] - consultation " << endl;
- cout << " [2] - other types of services " << endl;
- cout << " [3] - surgery " << endl;
- cout << " [4] - close " << endl;
- cout << "\n Please enter your choice: ";
- getline(cin, option);
- if (option == "1")
- {
- cout << " \n\n" << endl;
- cout << " You have chosen consultation service \n" << endl;
- cout << " Please wait for your name to be called in front of room 1 to 5 \n\n\n" << endl;
- system("color 0");
- system("pause");
- system("cls");
- string c_option;
- cout << " Welcome to Consultation Department \n\n\n"; //save a string
- cout << " What is your problem ? \n" << endl;
- cout << " [1] - Flu " << endl;
- cout << " [2] - Wound " << endl;
- cout << " [3] - Cough " << endl;
- cout << " [4] - previous Menu " << endl;
- cout << "\ Please enter your choice: ";
- getline(cin, c_option);
- cout << "\n\n\n\n";
- system("pause");
- if (c_option == "1")
- {
- check_temp:
- string temp;
- float temp2;
- float temp_value=0.0F;
- cout << " \n\n " ; //spacing
- cout << " What is your body temperature? \n\n";
- cout<< "\t\tEnter here:";
- //getline(cin, temp);
- cin >> temp_value;
- cout << "\n\n";
- if (temp_value > 39.0)
- {
- cout << " You need to be checked and warded " << endl;
- system("pause");
- system("cls");
- total_bill = total_bill + 10;
- print_bill(total_bill);
- }
- else
- {
- cout << " You have a normal fever " << endl;
- system("pause");
- system("cls");
- total_bill = total_bill + 10;
- print_bill(total_bill);
- }
- }
- if (c_option == "2")
- {
- cout << " The wound need to be disinfect and bandaged " << endl;
- system("cls");
- total_bill = total_bill + 10;
- print_bill(total_bill);
- }
- if (c_option == "3")
- {
- string cf_option;
- cout << " Does your tonsil have inflammation: [Y/N]? " << endl;
- cout << "Enter here:";
- getline(cin, cf_option);
- if (cf_option == "Y" || cf_option =="y")
- {
- cout << "\n\n";
- total_bill = total_bill + 10;
- goto check_temp;
- }
- else
- {
- cout << " Display “You have normal cough " << endl;
- system("cls");
- total_bill = total_bill + 10;
- print_bill(total_bill);
- }
- cout << "\n\n";
- }
- if (c_option == "4")
- {
- goto menu;
- }
- cout << "\n\n\n\n";
- system("pause");
- }//if
- other_option:
- if (option == "2") {
- system("color 0");
- system("pause");
- system("cls");
- cout << " Other types Service Department \n\n"; //save a string
- cout << " You have chosen the other type service \n" << endl;
- cout << " Please wait for your name to be called in front of room 9 to 10 \n\n" << endl;
- cout << " How was your health issue? " << endl;
- cout << " Is it serious issue[Y/N]? \n"<< endl;
- cout << "Enter here: ";
- string o_option;
- getline(cin, o_option);
- cout << "\n";
- if (o_option == "Y" || o_option == "y")
- {
- cout << " You will be checked thoroughly " << endl;
- system("cls");
- total_bill = total_bill + 5;
- print_bill(total_bill);
- }
- else
- {
- cout << " You will be checked normally " << endl;
- system("cls");
- total_bill = total_bill + 5;
- print_bill(total_bill);
- }
- cout << "\n\n\n\n";
- system("pause");
- system("cls");
- }
- if (option == "3")
- {
- string s_option, sy_option;
- system("pause");
- system("cls");
- cout << " Welcome to Surgery Department \n\n"; //save a string
- cout << " You have chosen surgery service " << endl;
- cout << " Please wait for your name to be called in front of room 6 to 8 " << endl;
- cout << "\n Do you have set an appointment before this {Y/N]?: " << endl;
- cout << "Enter here:";
- getline(cin, sy_option);
- cout << "\n\n";
- system("cls");
- if (sy_option == "Y" || sy_option =="y")
- {
- cout << " Surgery List \n\n"; //save a string
- cout << " [6] - optometris " << endl;
- cout << " [7] - audiologist " << endl;
- cout << " [8] - neurology " << endl;
- cout << " [9] - previous Menu " << endl;
- cout << "\n What type of surgery do you need:? \n" << endl;
- cout << "Enter here:";
- getline(cin, s_option);
- if (s_option == "6")
- {
- cout << " Please go to the optometrist department " << endl;
- system("cls");
- total_bill = total_bill + 1500;
- print_bill(total_bill);
- }
- if (s_option == "7")
- {
- cout << " Please go to the audiologist department " << endl;
- system("cls");
- total_bill = total_bill + 800;
- print_bill(total_bill);
- }
- if (s_option == "8")
- {
- cout << " Please go to the audiologist department " << endl;
- system("cls");
- total_bill = total_bill + 1500;
- print_bill(total_bill);
- }
- if (s_option == "9")
- {
- goto menu;
- }
- cout << "\n\n";
- }
- else
- {
- cout << " Set an appointment with the doctor for another day ? ";
- cout << "\n\n";
- system("cls");
- goto other_option;
- }
- cout << "\n\n\n\n";
- system("pause");
- system("color f");
- }
- if (option == "4")
- {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement