In: Computer Science
I need a flow chart built in raptor and the Java source code in the source folder (src)
Please fully document the program: add comments to describe all major parts of the solution. SO that I can understand how and why the code was built that way.
Problem specifications:
-The TSA want you to design and code a program that will be used to screen travelers through AirportX. When a traveler arrives at the airport, he/she is required to go through a checkpoint for COVID-19. The traveler temperature is checked and a recommendation is made for the traveler to be quarantined or not.
A traveler will be quarantined if all of the following conditions are met:
-the temperature read for the traveler is 100.4 or more degrees Fahrenheit.
-the traveler is coughing.
-the traveler is experiencing a shortness of breath.
What need to be collected about a traveler?
Beside collecting all of the above information about a traveler, the first name and last name and passport number of the traveler are collected only if the traveler is to be quarantined.
What to do?
-develop a full solution made up of a short analysis of the problem, a flowchart using Raptor, another flowcharting program, or even by hands, and a full Java program.
FLOWCHART
output
JAVA PROGRAM
import java.io.*;
import java.util.Scanner;
class COVIDSTATUS
{
public static void main(String [] args)
{
String fname,lname,passportNum,cough,breath;
double temp;
//create scanner object of Scanner class
Scanner read = new Scanner(System.in);
System.out.println("Body Temperature : ");
temp=read.nextDouble(); //READ THE BODY
TEMPERATURE
read.nextLine();
System.out.println("Do you have Cough(Yes/No) :
");
cough=read.nextLine(); //read the status of
cough
System.out.println("Have you experiencing a shortness
of Breath(Yes/No) : ");
breath=read.nextLine(); //read the status of breathing
problem
//condition to check whether all three symptoms
found
if(temp>=100.4 &&
cough.equalsIgnoreCase("yes") &&
breath.equalsIgnoreCase("yes"))
{
System.out.println("Enter first
name : ");
fname = read.nextLine();//read
first name
System.out.println("Enter Last name
: ");
lname = read.nextLine();//read last
name
System.out.println("Enter Passport
Number : ");
passportNum= read.nextLine();//read
passport number
System.out.println(fname+"
"+lname+" You have symptoms of COVID-19");
System.out.println("Passport Number
: "+passportNum);
System.out.println("Body
Temperature :"+temp);
System.out.println("Cough
:"+cough);
System.out.println("Breathing
Problem :"+breath);
System.out.println("You have to
Quarantined.");
}
else
{ //BLOCK FOR NOT QUARANTINED
System.out.println("Body
Temperature :"+temp);
System.out.println("Cough
:"+cough);
System.out.println("Breathing
Problem :"+breath);
System.out.println("You will not
Quarantined");
}
}
}
OUTPUT