Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

double carport =100, garage = 150, neither = 0; System.out.println(\"Please choo

ID: 3617119 • Letter: D

Question

double carport =100, garage = 150, neither = 0;
                               System.out.println("Please choose one of the apartments above, butbefore you do so, ");
                               System.out.println("do you want to add Carport or Garage orneither? We will just add it to your monthly bill");
                               System.out.printf("Garage price is $%.2f Carpot price is$%.2f ",garageFees, carportFees);
                              
                               double carAccess = switchInput.nextDouble();
                              /**
                               * input error checking to make sure the user entered the rightamount
                               */
                              while(carAccess != carport)
                                 while(carAccess != garage)
                                     while(carAccess != neither)
                                     {
                                           System.out.printf("Wrong input: Please reenter which youprefer ");
                                           System.out.printf(" Must be 150 or 100 or 0: ");
                                           carAccess = switchInput.nextDouble();
                                     }
                               System.out.println("carportFees is " +carportFees+" " +garageFees+"" +neitherFees);

                        for(int tindex=0;tindex<maxTen;tindex++)
                        {
                              System.out.println(" Enter the apartment you desire then brieflyenter your personal information.");
                              System.out.println("Please choose one of the above apartmentssuitable for you.");
                              System.out.print("Enter the apartment number: ");
                              chooseAptNumber = switchInput.nextInt();

Explanation / Answer

please rate - thanks change while(carAccess !=carport)                                  while(carAccess != garage)                                      while(carAccess != neither)                                      {                                            System.out.printf("Wrong input: Please reenter which youprefer ");                                            System.out.printf(" Must be 150 or 100 or 0: ");                                            carAccess = switchInput.nextDouble();                                      } to while(carAccess !=carport)&&(carAccess != garage)&&(carAccess !=neither)                                      {                                            System.out.printf("Wrong input: Please reenter which youprefer ");                                            System.out.printf(" Must be 150 or 100 or 0: ");                                            carAccess = switchInput.nextDouble();                                      }