Answer to Question #194408 in Java | JSP | JSF for Caleb

Question #194408

You must design a COVID-19 screening application for your campus. The guards at each gate will screen the students . The capabilities and features of the application should include a choice between the following functions:

1. A screening survey which will allow guards to record the students’ screening data.

 *No student should be allowed access to the campus after 12h00 in the afternoons regardless of whether capacity has been reached or not.

*If a student’s temperature is 38 degrees or more, they will not be allowed entry into the campus.



1
Expert's answer
2021-05-19T01:37:41-0400
import java.util.Scanner;


public class Q194408 {
	/**
	 * The start point of the program
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		String studentNames[] = new String[300];
		String studentTimes[] = new String[300];
		int studentTemperatures[] = new int[300];
		int totalStudentsAdded = 0;
		int ch = -1;
		while (ch != 3) {
			System.out.println("1. Record the student's screening data");
			System.out.println("2. Display all  students");
			System.out.println("3. Exit");
			System.out.print("> ");
			ch = input.nextInt();
			if (ch == 1) {
				input.nextLine();
				System.out.print("Input the student name: ");
				studentNames[totalStudentsAdded] = input.nextLine();
				System.out.print("Input hours: ");
				int hour = input.nextInt();
				System.out.print("Input minutes: ");
				int minutes = input.nextInt();
				System.out.print("Input temperature: ");
				int tmp = input.nextInt();
				if (hour < 1 || minutes < 0 || hour > 12 || minutes > 59 || tmp >=38 || tmp < 34) {
					System.out.println("Wrong data.");
				}else {
					studentTimes[totalStudentsAdded] = hour+ ":" +minutes;
					studentTemperatures[totalStudentsAdded] = tmp;
					totalStudentsAdded++;
				}
			} else if (ch == 2) {
				for (int i = 0; i < totalStudentsAdded; i++) {
					System.out.println("The student name: " + studentNames[i]);
					System.out.println("The student time: " + studentTimes[i]);
					System.out.println("The student temperature: " + studentTemperatures[i] + "\n");
				}
			} else if (ch == 3) {
				// exit
			} else {
				System.out.println("Wrong data.");
			}
		}
		input.close();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS