Menu

[Solved] Package Testipad Import Javautilscanner Public Class Ipadcost Public Static Void Main Stri Q37161029

package test.ipad;

import java.util.Scanner;

public class IpadCost {

public static void main(String[] args){

int numOfIpad; //this will be used to capture number of ipadsfor a classroom

  

//below variables are given as per the question

double costOfIpadInDollar = 799;

double salsTaxInPercent = 8.2;

int totalNumOfClassroom = 10;

int maxNumOfIpadPerClass = 20;

// this array will be maintained to store totalcost of ipadsincluding sales tax for every classroom

//since total number of classroom is defined hence the arraysize is also bound to the number of clasroom

double[] totalIpadCostArr = new double[totalNumOfClassroom];

  

//below variables will be used to calculate for everyclassroom

double totalIpadOnlyCost,totalSalesTax,totalCostForClass;

  

int classroomCounter = 0;//counter will be used in whileloop

  

Scanner sc = new Scanner(System.in); //scanner will be used toread teacher’s input

  

while(classroomCounter < totalNumOfClassroom){

System.out.println(“Please enter the number of Ipad needed forclassroom#”+(classroomCounter+1)+” :”);

  

//since the read data in String format hence need to convert ittto integer.

numOfIpad = Integer.parseInt(sc.next());

if(numOfIpad > maxNumOfIpadPerClass){ //as the entered datacannot exceed 20

System.out.println(“Number of ipad cannot exceed”+maxNumOfIpadPerClass+” per class!!”);

//classroom counter is not incremented here. so it will againprompt the user for the input.

}else {

//calculation logic for totalcost

totalIpadOnlyCost = numOfIpad*costOfIpadInDollar;

totalSalesTax = totalIpadOnlyCost*(salsTaxInPercent/100);

totalCostForClass = totalIpadOnlyCost+totalSalesTax;

  

//the total cost is stored in array to use that value later

totalIpadCostArr[classroomCounter] = totalCostForClass;

  

classroomCounter++;//go for next classroom’s data

}

}

sc.close();//close the scanner

  

//print each classroom’s cost

for(int i = 0; i < totalIpadCostArr.length ; i++){

System.out.println(“Total ipad cost for classroom#”+(i+1)+ ” is$”+totalIpadCostArr[i]);

}

}

}

is this code i created. (

part A,B,C)

i need help solving the rest. JAVA

create the Java code with the below criteria to be executed without errors: (20 points) a. You must use a while loop to get t

create the Java code with the below criteria to be executed without errors: (20 points) a. You must use a while loop to get the teacher’s input for the number of iPads needed b. You must use an if/else statement to ensure the number of iPads can’t exceed 20. c. Provide the modified code or a screenshot of the code in Jdoodle. You are in charge of the school’s IT department and several classes are asking to by iPads for use in their classes. Based on the number of iPads each class requested, determine the total costs for each classroom. The only information given is that the iPad costs $799, sales tax is 8.2% and there is a total of 10 classrooms. HINT: You will need to get the teacher’s input for the amount that their class will need. Create a test case table with at least 5 test cases. Execute each test case and provide a screenshot of the execution .Create an array list of students’ first and last names for each of the 10 classrooms. The number of students in the class has to be greater than 10 but less than 20. Provide the modified code or a screenshot of the code in Jdoodle. Based on the number of inputs used for each classroom, remove student’s name from the array list so that the number iPads reflect the number of students in the class. Provide the modified code or a screenshot of the code in Jdoodle. Modify your code to now have the formula you used to calculate the total cost as method. Create an additional subclass using the following parameters: (20 points) 1) Create a Chromebook class 2) Under the Chromebook class you created, ask the user the number of Chromebooks they will need for each class. 3) The Chromebooks cost S250.00 and the sales tax is 8.2%. 4) Call the method you created for total cost formula, modify it with the new cost and tax information and print the output. 5) Provide a screenshot of the code and output and attach to your document. Show transcribed image text create the Java code with the below criteria to be executed without errors: (20 points) a. You must use a while loop to get the teacher’s input for the number of iPads needed b. You must use an if/else statement to ensure the number of iPads can’t exceed 20. c. Provide the modified code or a screenshot of the code in Jdoodle. You are in charge of the school’s IT department and several classes are asking to by iPads for use in their classes. Based on the number of iPads each class requested, determine the total costs for each classroom. The only information given is that the iPad costs $799, sales tax is 8.2% and there is a total of 10 classrooms. HINT: You will need to get the teacher’s input for the amount that their class will need. Create a test case table with at least 5 test cases. Execute each test case and provide a screenshot of the execution .Create an array list of students’ first and last names for each of the 10 classrooms. The number of students in the class has to be greater than 10 but less than 20. Provide the modified code or a screenshot of the code in Jdoodle. Based on the number of inputs used for each classroom, remove student’s name from the array list so that the number iPads reflect the number of students in the class. Provide the modified code or a screenshot of the code in Jdoodle. Modify your code to now have the formula you used to calculate the total cost as method. Create an additional subclass using the following parameters: (20 points) 1) Create a Chromebook class 2) Under the Chromebook class you created, ask the user the number of Chromebooks they will need for each class. 3) The Chromebooks cost S250.00 and the sales tax is 8.2%. 4) Call the method you created for total cost formula, modify it with the new cost and tax information and print the output. 5) Provide a screenshot of the code and output and attach to your document.

Expert Answer


Answer to package test.ipad; import java.util.Scanner; public class IpadCost { public static void main(String[] args){ int numOfIp… . . .

OR


Leave a Reply

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