Answered You can hire a professional tutor to get the answer.

QUESTION

Follow the comments in the code, as these include more instructions. The code should be able to calculate the total and then add the tax of 2.3%, to...

Follow the comments in the code, as these include more instructions. The code

should be able to calculate the total and then add the tax of 2.3%, to print out the final total.

Also note that there are various places with empty comments ("//"s with nothing after it) - fill in your own

comments here to describe the code below that line. The code is below!

import java.util.Scanner;

public class LabQuestion8 {

public static void main(String[] args) {

//---- Declare all the variables here

int choice = 0, num = 0;

double total = 0;

Scanner scan;

final double tax = 0;

//-----------------------------------

System.out.println("Please select 1 of the following options to buy: ");

System.out.println("1. Shirts (7$ / item)");

System.out.println("2. Pants (10$ / item)");

System.out.println("3. Top  (5$ / item)");

//On the next line, write the code to scan an integer called choice. Use the necessary input

//

if(choice == 1)

{

//Here, ask the user how many shirts they would like to buy. Based on that quantity and the price per shirt, calculate the total.

//

}

else if(choice == 2)

{

//Here, ask the user how many pants they would like to buy. Based on that quantity and the price per pants, calculate the total.

//

}

else if(choice == 3)

{

//Here, ask the user how many top they would like to buy. Based on that quantity and the price per top, calculate the total.

//

}

total = total * tax; //

System.out.println("Hello Customer, Thank you for your purchase at our store.");

// below, write the code to print the total bill

System.out.println("Your total bill was : ");

}

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question