Question

According to infectious disease experts, COVID-19 symptoms can range from mild, to moderate, and severe. The...

According to infectious disease experts, COVID-19 symptoms can range
from mild, to moderate, and severe. The symptoms are as follows for each
category.
        
        Mild: moderate fever (98.6 F t 100.4 F, respiratory symptoms, 
        aches, pains, and dry cough. 
        
        Moderate: Fever above 100.4, cough, chills, shortness of 
        breather, and tiredness.
        
        Severe: Drop in blood pressure, inflammation, and pneumonia.
        
FOR EXAMPLE: User (healthcare provider) is asked to input a symptom from up above such as "drop in blood pressure" the system then needs to output "possible severe case of COVID-19, please request more confirmatory blood tests." Another example of an input would be "tiredness" this would result in an output of "possible moderate case of COVID-19, please request more confirmatory blood tests."
      
 QUESTION: Write a Java program that prompts a healthcare provider to enter the
        symptoms of a patient based on any of the classifications above. The 
        system then returns the possible classification of COVID-19 above and requests
        for additional confirmatory blood tests.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

# If you have a query/issue with respect to the answer, please drop a comment. I will surely try to address your query ASAP and resolve the issue

# # Please consider providing a thumbs up to this question if it helps you. by doing that, you will help other students who are facing a similar issue.

//--------------------INPUT/OUTPUT------------------

//-------------------------------------------------------------

import java.util.Scanner;

class Main {

    public static void main(String[] args) {

        //array with mild symptoms

        String[] mild_symptoms = { "moderate fever", "respiratory symptoms", "aches", "pains", "dry cough" };

        //array with moderate symptoms

        String[] moderate_symptoms = { "fever above 100.4", "shortness of breathe", "aches", "chills", "cough",

                "tiredness" };

        

        //array with severe symptoms

        String[] severe_symptoms = { "drop in blood pressure","inflammation", "pneumonia" };

        Scanner scanner=new Scanner(System.in);

        //prompt the user

        System.out.print("Please enter symptoms: ");

        //read input

        String symp=scanner.nextLine().toLowerCase();

        String severity="";

        //search the arrays one by on for symptom

        if (search(mild_symptoms, symp)){

            severity="mild";

        }

        else if(search(moderate_symptoms, symp)){

            severity="moderate";

        }

        else if(search(severe_symptoms, symp)){

            severity="severe";

        }

        

        //check if severity string still empty

        if(severity.equals("")){

            System.out.println("Not a case of COVID-19");

        }

        else{

            System.out.println("possible "+severity+" case of COVID-19, please request more confirmatory blood tests.");

        }

    }

    //a function to search the array for string

    public static boolean search(String[] list, String symptom) {   

        //loop over the array one by one

        for (int i = 0; i < list.length; i++) {

            //checks if current elment equals symptom

            if (list[i].equals(symptom)) {

                return true;

            }

        }

        return false;

    }

}

Add a comment
Know the answer?
Add Answer to:
According to infectious disease experts, COVID-19 symptoms can range from mild, to moderate, and severe. The...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 26% -), AT&T LTE 10:08 AM Capstone Case Studies.. Case Study and Questions A 65-year old...

    26% -), AT&T LTE 10:08 AM Capstone Case Studies.. Case Study and Questions A 65-year old man entered the emergency department of a local hospital. He appeared to be acutely ill with abdominal tenderness and a temperature ef 40" C. The patient was taken to urpery because appendicitis was suspected. A ruptured appendix surounded by 20 ml of foul-smelling pus was Sound at laparotomy. The pus was drained and submitied Sor acrobic and anacrobie bacterial culture analysis. Postoperatively, the patient...

  • Health Record Face Sheet Record Number: 70-50-77 Age: 53 Gender: Male Length of Stay: 2 Days...

    Health Record Face Sheet Record Number: 70-50-77 Age: 53 Gender: Male Length of Stay: 2 Days Service Type: INPATIENT Discharge Status: To Home Diagnosis/Procedure: Idiopathic Dilated Cardiomyopathy DISCHARGE SUMMARY PATIENT NAME: HUGH ACUTE ADMISSION DATE: 06-23-XX DISCHARGE DATE: 06-25-XX DISCHARGE DIAGNOSIS: 1. Idiopathic dilated cardiomyopathy, uncertain etiology. 2. Left bundle branch block. 3. Normal coronary arteries and normal hemodynamics. PROCEDURES: Cardiac catheterization. HISTORY OF PRESENT ILLNESS: The patient is a 53-year-old male admitted for evaluation of grossly abnormal Thallium test....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT