Menu

[Solved]Java Code Created Question Import Javautilscanner Public Class Ipods Public Static Void Ma Q37136607

Java code created for this question:

import java.util.Scanner;

public class Ipods {

   public static void main(String[] args){

       // 10classes

       int arr[] = newint[10];

       Scanner sc = newScanner(System.in);

       int i = 0,n;

       //reading thequantity for each class

       while (i < 10){

          System.out.println(“Enter the number of Ipads required for class “+ (i + 1));

          n = sc.nextInt();

          // checking if the quantity is less than 20

          if (n < 20) {

              //storing in array

              arr[i++] = n;

          } else {

              System.out.println(“Quantity must be less than 20”);

          }

       }

       i = 0;

       double total = 0,cTotal = 0;

       while (i < 10){

          //calculating the total bill

          cTotal = arr[i] * 799;

          //adding 8.2% tax

          cTotal = 1.082 * cTotal;

          //adding total

          total += cTotal;

          System.out.println(“Class ” + (i + 1) + ” total : $” +cTotal);

          i++;

       }

      System.out.println(“Total Bill :$” + total);

   }

}

Question States: Based on the number of inputs used foreach classroom, remove student’s name from the array list so thatthe number iPads reflect the number of students in the class.Provide the modified code or a screenshot of the code in Jdoodle.(20 points

Expert Answer


Answer to Java code created for this question: import java.util.Scanner; public class Ipods { public static void main(String[] arg… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *