Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
- import java.io.*;
- public class Hospital_Management_Program
- {
- //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
- public static void main(String args[])throws IOException
- {
- InputStreamReader isr=new InputStreamReader(System.in);
- BufferedReader br=new BufferedReader(isr);
- String[] Patient_Name = new String[1000];
- String[] Patient_Sex = new String[1000];
- int[] Patient_Age = new int[1000];
- //and so on declare all the variables like Blood Group, Address,
- //Contact Number, Height, Weight, Medical Conditions, Doctor Allotted, etc.
- int option=0;
- int counter=-1;
- int option1=0;
- int option2=0;
- int option3=0;
- int infinity=0;
- for(;infinity==0;)
- {
- System.out.println("Please select any one of the following options:");
- System.out.println("1 Enter A New Record");
- System.out.println("2 Search Exisiting Records");
- System.out.println("3 Close The Program And Erase All Records");
- option=Integer.parseInt(br.readLine());
- for(;option==1;)
- {
- counter++;
- System.out.println("Enter the patient's full name:");
- Patient_Name[counter]=br.readLine();
- System.out.println("Enter the patient's sex:");
- Patient_Sex[counter]=br.readLine();
- System.out.println("Enter the patient's age:");
- Patient_Age[counter]=Integer.parseInt(br.readLine());
- //and so on for all the variables like Blood Group, etc.
- System.out.println("You have now successfully entered the patient's details into the system. Type 1 to enter a new patient's details. Type 2 to go back to the main menu:");
- option1=Integer.parseInt(br.readLine());
- if(option1==2)
- {
- break;
- }
- else
- {
- }
- }
- for(;option==2;)
- {
- System.out.println("Enter the correct name:");
- //I don't remember how to use Array search as it has been a long time, but you must get the point, right Sneha? Simply use array search to search for the exact name in the
- //Patient_Name String array and then display all that patient's information. Easy.
- //If he enters something wrong, display an error or something. Otherwise, once the correct information is displayed,
- System.out.println("Type 1 to search for another patient's details. Type 2 to go back to the main menu:");
- option2=Integer.parseInt(br.readLine());
- if(option2==2)
- {
- break;
- }
- else
- {
- }
- }
- for(;option==3;)
- {
- break;
- }
- }
- //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
- }
- }
- //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
Add Comment
Please, Sign In to add comment