Corona Virus Test Using Java
package com.java.basicprograms;
import java.util.*;
public class CoronaVirusTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enetr patient symptoms");
String str = sc.nextLine();
String[] word = str.split(" ");
boolean isTrue = false;
List<String> dList = new ArrayList<String>();
dList.add("cough");
dList.add("fever");
dList.add("tiredness");
dList.add("difficultybreathing");
for (int i = 0; i < word.length; i++) {
if (dList.contains(word[i])) {
isTrue = true;
} else {
isTrue = false;
}
}
if (isTrue) {
System.out.println("The Patient need to go for Corona Test");
} else {
System.out.println("The Patient doesnot have Corona");
}
}
}
import java.util.*;
public class CoronaVirusTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enetr patient symptoms");
String str = sc.nextLine();
String[] word = str.split(" ");
boolean isTrue = false;
List<String> dList = new ArrayList<String>();
dList.add("cough");
dList.add("fever");
dList.add("tiredness");
dList.add("difficultybreathing");
for (int i = 0; i < word.length; i++) {
if (dList.contains(word[i])) {
isTrue = true;
} else {
isTrue = false;
}
}
if (isTrue) {
System.out.println("The Patient need to go for Corona Test");
} else {
System.out.println("The Patient doesnot have Corona");
}
}
}
Comments
Post a Comment