Aquapodz.java - import java.util.Scanner public class...

This preview shows page 1 - 2 out of 2 pages.

import java.util.Scanner; public class Aquapodz { public static void main(String[] args) { char Azuview = 'a'; char Bublon = 'b'; char Cryzatal = 'c'; char command1; Scanner scnr = new Scanner(System.in); System.out.println("Please enter a command:"); command1 = scnr.next().charAt(0); int afailures; while (command1 != 'x') { if (command1 =='a') { afailures = 0; System.out.println("Enter number 1:"); double number1a = scnr.nextDouble(); System.out.println("Enter number 2:"); double number2a = scnr.nextDouble(); System.out.println("Enter number 3:"); double number3a = scnr.nextDouble(); System.out.println("Please enter a command:"); command1 = scnr.next().charAt(0); if (number1a < -6.0 || number1a > 12.3) { afailures = afailures + 1; } else { afailures = afailures + 0; } if (number2a < -6.0 || number2a > 12.3) { afailures = afailures + 1; } else { afailures = afailures + 0; } if (number3a < -6.0 || number3a > 12.3) { afailures = afailures + 1; } else { afailures = afailures + 0; } }

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture