- /rahaf omar alomar/435201926/42077/import...

  • No School
  • AA 1
  • 4

This preview shows page 1 - 2 out of 4 pages.

//rahaf omar alomar //435201926 //42077 //import necessary libraries import java.util.*; public class Hospital1 { static Scanner read = new Scanner (; //global varibles public static Patient1[] patientsList; public static void main (String [] args ) { //declaration section - local varibles int size , choice , priority; char gender; String name, ID , admissionDate , releaseDate; //input section System.out.println(" Enter the number of patients:"); size= read.nextInt(); patientsList = new Patient1 [size]; do { // display a menu System.out.println(" Enter your choice:"); System.out.println("1- Add new patient."); System.out.println("2- Retrive patient's information."); System.out.println("3- Arrange patients based on priority."); System.out.println("4- Display all patients' information."); System.out.println("5- Exit."); choice = read.nextInt(); switch ( choice ) { case 1 : // add parient //input section System.out.println(" Enter the patient's name:"); read.nextLine(); name = read.nextLine(); System.out.println(" Enter the patient's ID:"); ID =; System.out.println(" Enter the patient's gender: ( M / F )"); gender =; System.out.println(" Enter the patient's priority:"); priority = read.nextInt();
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Fall '19
  • omar alomar, public static Patient1

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes