I'm trying to simulate heart function. This code should accept either 0 or 1 for inputs and compare the variables declared, and either return a value or pass to the next function.
import java.util.Scanner;
public class Heart {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter the value of the rightAtrium: ");
int rightAtrium = in.nextInt();
System.out.println("Enter the value of the tricuspidValve: ");
int tricuspidValve = in.nextInt();
System.out.println("Enter the value of the rightVentricle: ");
int rightVentricle = in.nextInt();
System.out.println("Enter the value of the pulmonaryValve: ");
int pulmonaryValve = in.nextInt();
System.out.println("Enter the value of the leftAtrium: ");
int leftAtrium = in.nextInt();
System.out.println("Enter the value of the mitralValve: ");
int mitralValve = in.nextInt();
System.out.println("Enter the value of the leftVentricle: ");
int leftVentricle = in.nextInt();
System.out.println("Enter the value of the aorticValve: ");
int aorticValve = in.nextInt();
if (rightAtrium == 1 && tricuspidValve ==1){
//Do nothing
}else if (tricuspidValve== 0 && rightVentricle==1 && pulmonaryValve==1){
//Go to the Oxygenation Process
}else if (leftAtrium== 1 && mitralValve==1){
//next
}else if (mitralValve==0 &&leftVentricle== 1 &&aorticValve==1){
//next: got to systemic circulation
}
System.out.println("Still workingon this: ");
}
}
Aucun commentaire:
Enregistrer un commentaire