Draw a venn diagram showing an event along with its sufficient and necessary conditions

Consider some event S along with:

  • Sn (Necessary events for S)
  • Ss (Sufficient events for S)
  • Sns (Necessary and sufficient events for S)

Draw a venn diagram indicating the above.

This is my attempt, Venn Diagram, I’m not sure if I’m on the right track and I also don’t know where to indicate Sns (necessary and sufficient)

Any help would be appreciated

Q : Loops along with If-statements & else if statements | Rental Car Calculator Project (WHOLE DAYS ONLY)

At the prompt: “System.out.print(“What vehical would you like to rent?\n”); ” I can not figure out why when a number that is not 1-3 is entered it will not repeat the loop as I want OR display any input I’ve entered for the system.print

Second, I can not figure how to make an if statement only allowing the user to enter 1 or 0 when prompted: “System.out.println(“If there are any customer press 1 else press 0″);” Without making an error in my loop for summary data or counts.

package inter;  import java.util.InputMismatchException; import java.util.Scanner;  public class Inter { public static void main(String []args){ int count=0; int days; double DailyFee=0, NontaxTotal, CarType, Total,FullTotal=0; boolean F1 = false, F2 = false; Scanner in=new Scanner(System.in); System.out.println("If there are any customer press 1 else press 0"); int cus=in.nextInt();      while(cus!=0){         while(F1 == false) {             F1 = true;             count++;             System.out.print("What vehical would you like to rent?\n");             System.out.println("Enter 1 for an economy car");             System.out.println("Enter 2 for a sedan car");             System.out.println("Enter 3 for an SUV");             CarType = in.nextInt();             try {                 CarType = in.nextInt();                 if (CarType <= 0 || CarType >= 4) {                     System.out.print("Number must be 1-3\n");                     System.out.println("Please enter 1 for an economy car");                     System.out.println("Enter 2 for a sedan car");                     System.out.println("Enter 3 for an SUV");                     CarType = in.nextInt();                     F1 = false;                 } else {                      if (CarType == 1) {                          F1 = true;                           DailyFee=31.76;                 } else if(CarType == 2) {                         F1 = true;                           DailyFee=40.32;                 } else if(CarType == 3) {                         F1 = true;                           DailyFee=47.56;                 }                 while (F2 == false) {                     F2 = true;                     try {                          System.out.print("Please enter the number of days rented. (Example; 3) : ");                         days = in.nextInt();                          if (days <= 0) {                             System.out.println("Number of days must be more than zero");                             F2 = false;                         } else {                             days = in.nextInt();                             double x=days;                             NontaxTotal = (DailyFee * x);                             Total = (NontaxTotal * 1.06);                             FullTotal+=Total;                         }                     } catch(InputMismatchException ex) {                         System.out.println("Answer must be a number");                         F2 = false;                         in.next();                         }                     }                 }             } catch (InputMismatchException ex) {                 F1 = false;                 System.out.println("Answer must be a number");              }         }      }     in.close();     System.out.println("Count of customers : "+count);     System.out.printf("Total of the Day : $   %.2f",FullTotal); } 

}