theadarshmehta

Hospital Management Program

Sep 6th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.07 KB | None | 0 0
  1. //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
  2.  
  3. import java.io.*;
  4.  
  5. public class Hospital_Management_Program
  6.  
  7. {
  8.     //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
  9.    
  10.     public static void main(String args[])throws IOException
  11.    
  12.     {
  13.         InputStreamReader isr=new InputStreamReader(System.in);
  14.         BufferedReader br=new BufferedReader(isr);
  15.        
  16.         String[] Patient_Name = new String[1000];
  17.         String[] Patient_Sex = new String[1000];
  18.         int[] Patient_Age = new int[1000];
  19.         //and so on declare all the variables like Blood Group, Address,
  20.         //Contact Number, Height, Weight, Medical Conditions, Doctor Allotted, etc.
  21.         int option=0;
  22.         int counter=-1;
  23.         int option1=0;
  24.         int option2=0;
  25.         int option3=0;
  26.         int infinity=0;
  27.        
  28.         for(;infinity==0;)
  29.         {
  30.         System.out.println("Please select any one of the following options:");
  31.         System.out.println("1 Enter A New Record");
  32.         System.out.println("2 Search Exisiting Records");
  33.         System.out.println("3 Close The Program And Erase All Records");
  34.         option=Integer.parseInt(br.readLine());
  35.        
  36.         for(;option==1;)
  37.         {
  38.             counter++;
  39.             System.out.println("Enter the patient's full name:");
  40.             Patient_Name[counter]=br.readLine();
  41.             System.out.println("Enter the patient's sex:");
  42.             Patient_Sex[counter]=br.readLine();
  43.             System.out.println("Enter the patient's age:");
  44.             Patient_Age[counter]=Integer.parseInt(br.readLine());
  45.             //and so on for all the variables like Blood Group, etc.
  46.             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:");
  47.             option1=Integer.parseInt(br.readLine());
  48.             if(option1==2)
  49.             {
  50.                 break;
  51.             }
  52.             else
  53.             {
  54.             }
  55.            
  56.         }
  57.        
  58.         for(;option==2;)
  59.         {
  60.             System.out.println("Enter the correct name:");
  61.             //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
  62.             //Patient_Name String array and then display all that patient's information. Easy.
  63.             //If he enters something wrong, display an error or something. Otherwise, once the correct information is displayed,
  64.             System.out.println("Type 1 to search for another patient's details. Type 2 to go back to the main menu:");
  65.             option2=Integer.parseInt(br.readLine());
  66.             if(option2==2)
  67.             {
  68.                 break;
  69.             }
  70.             else
  71.             {
  72.             }
  73.         }
  74.        
  75.         for(;option==3;)
  76.         {
  77.             break;
  78.         }
  79.     }
  80.    
  81.     //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
  82.    
  83.     }
  84.    
  85. }
  86.  
  87. //PROGRAM BY THE ADARSH MEHTA www.theadarshmehta.in
Add Comment
Please, Sign In to add comment