Answer to Question #285485 in Java | JSP | JSF for Saphira

Question #285485

Create a Java program that will utilize conditional statements to check if a student wishes to join and is qualified to join the limited Face-to-Face classes. There are four (4) requirements in order to join:



SAMPLE OUTPUT 1:

Would you be joining the LF2F classes?  Yes

Are you fully vaccinated?  Yes

Do you have health insurance that covers COVID cases?  Yes

Did your parents allow you to join LF2F classes?  Yes

Are you registered with Stay Safe PH?  Yes

That's great! You can join the limited Face-to-Face classes!

 

SAMPLE OUTPUT 2:

Would you be joining the LF2F classes?  Yes

Are you fully vaccinated?  Yes

Do you have health insurance that covers COVID cases?  No

Did your parents allow you to join LF2F classes?  No

Are you registered with Stay Safe PH?  Yes

We are sorry to inform you that you are not allowed to join the limited Face-to-Face classes.

 

SAMPLE OUTPUT 3:

Would you be joining the LF2F classes?  No

You may answer your laboratory activities at home.

1
Expert's answer
2022-01-07T13:49:43-0500
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Would you be joining the LF2F classes? ");
        boolean join = in.next().equalsIgnoreCase("Yes");
        if (!join) {
            System.out.println("You may answer your laboratory activities at home.");
            return;
        }
        System.out.print("Are you fully vaccinated? ");
        boolean vaccine = in.next().equalsIgnoreCase("Yes");
        System.out.print("Do you have health insurance that covers COVID cases? ");
        boolean insurance = in.next().equalsIgnoreCase("Yes");
        System.out.print("Did your parents allow you to join LF2F classes? ");
        boolean allow = in.next().equalsIgnoreCase("Yes");
        System.out.print("Are you registered with Stay Safe PH? ");
        boolean register = in.next().equalsIgnoreCase("Yes");
        if (vaccine && insurance && allow && register) {
            System.out.println("That's great! You can join the limited Face-to-Face classes!");
        } else if (vaccine && !insurance && !allow && register) {
            System.out.println("We are sorry to inform you that you are not allowed to join the limited Face-to-Face classes.");
        }
    }
}

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