Home
Expert Answers
Place Order
How It Works
About Us
Contact Us
Sign In / Sign Up
Sign In
Sign Up
Home
/
Expert Answers
/
Computer Science
/ create-a-flowchart-based-on-the-java-language-given-patient-1-and-patient-2-create-a-flowch-pa623
(Solved): Create a flowchart based on the java language given. Patient 1 and patient 2. Create a flowch ...
Create a flowchart based on the java language given. Patient 1 and patient 2.
Create a flowchart based on the java language given. Patient 1 and patient 2. package lecturesession; import java.util.Scanner; public class task 1\{ public static void main(String args[])\{ class patient \{ public String name, numberic; patient (String p_name, String p_numberic)\{ this. name = p_name; this.noic = p_number ic; \} \} class condi\{ public String condition; condi(String p_name)\{ this.condition = p_name; \} \} Scanner input \( = \) new Scanner(System.in); int count \( =0 \); int purpose; int opt \( =0 \); System.out.println("RAMSAY"); System.out.println("details :"); String name = input. nextLine \( ) \); System.out.println("Patient's IC number :"); String noic = input.nextLine(); patient pobj \( = \) new patient(name, noic); System.out.println( \( { }^{m *+1} \) Purpose of visit : 1. Walk-in. 2. Appointment. 3. Exit. "'"' \( ) \); purpose = input.nextlnt(); if \( ( \) patient \( ==1)\{ \) System.out.println("Total condition?"); int more_condi = input.nextlnt(); input.nextLine(); for(int \( i=0 ; i< \) more_condi \( ; i++)\{ \) System.out.println("" Select your symptoms. 1. Cough 2. Flu 3. Influenza 4. Others "m"'); int condi_op = input.nextlnt(); input.nextLine(); condi obj] = new condi[more_condi]; String condition \( = \) "' \( ; \) switch (condi_op) \{ case 1 -> condition = "Cough"; case 2 -> condition = "Flu"; case \( 3 \rightarrow \) condition \( = \) "Influenza"; case 4 -> condition = "Others"; default -> System.out.println("Exit."); \} System.out.println(more_condit" condition, "); obj[i]= new condi(condition); \} \} else if \( ( \) patient \( ==2 \) ) \{ System.out.println( \( { }^{m m+1} \) 1. Existing appointment. 2. Create a new appointment. opt = input.nextlnt(); if \( (\mathrm{opt}==1)\{ \) System.out.println("Date for appointment"); \} else if \( (\mathrm{opt}==2) \) System.out.println("New appointment date."); \} else System.out.println("Thank you."); \} \}
We have an Answer from Expert
View Expert Answer
Expert Answer
here i
We have an Answer from Expert
Buy This Answer $5
Place Order
We Provide Services Across The Globe
Order Now
Go To Answered Questions