Follow the comments in the code

Assignment Help Basic Computer Science
Reference no: EM131848511

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 : ");

}

}

 

Reference no: EM131848511

Questions Cloud

Create a tax plan for the future redemption : Create a tax plan for the future redemption of the client's stock owned in the construction company that will not be taxed according to Section 301 of the IRC.
Granted access to an efs-encrypted file : Please describe what a "FEK" is and how it's used? Feel free to research EFS. With some detail, how can multiple people be granted access to an EFS-encrypted
Differences between ntfs disk quotas and fsrm quotas : What are the differences between NTFS disk quotas and FSRM quotas? How do each actually determine usage?
Identify a change or innovation that benefit current field : Identify a change or innovation that would benefit your current field of specialization(Emergency Management Specialist)
Follow the comments in the code : 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
Research on security vulnerabilities associated with scada : Research on security vulnerabilities associated with SCADA and digital industrial control systems. Summarize the major security concerns .
Given the following array what is the first element : Given the following array what is the first element?
Describe key components of strategic planning process : Identify the strategic planning outcomes. Keep in mind that outcomes should be specific and measurable. Describe key components of strategic planning process.
Compute the profit and loss from only the repo transaction : Compute the profit/loss from ONLY the Repo transaction. Which of these bonds will you use for the Repo transaction?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Calculate the quoted futures price for the contract

The term structure is flat, and the rate of interest wit semiannual compounding is 12% per annum. The conversion factor for the bond is 1.5. The current quoted bond price is $110. Calculate the quoted futures price for the contract.

  Keep track of how new technology

Develop a response to the following essay prompt: The quest to define and regulate privacy is severely hindered by the multifaceted nature of this concept.

  What is refractive index

What is refractive index State the reason why when a ray of light strikes a mirror at 900, the reflected ray travels along the same path as the incident ray

  Online search for a good or service offered

Online search for a good or service offered in another country

  Firm profit maximization problem

Consider a numerical example for the firm's profit maximization problem. Suppose that the firm's production function is y=ln(K) +ln(N) . The firm's initial capital is K= 1.5. The current period wage rate is w= 0.1, the future period wage rate is w..

  Displays the total income from the billing records

First write a driver program to test all your methods, then write a test program that creates at least two patients at least two doctors.

  Cost controls and resource management systems

Choose from one of the two options below to create a flowchart, and then complete a summary on cost controls and resource management systems.

  Wap-prints a table of binary equivalents of decimal numbers

(Table of Decimal, Binary, Octal and Hexadecimal Equivalents) Write a program that prints a table of the binary, octal and hexadecimal equivalents.

  What is the least number of triple operations required

What is the least number of triple operations required in the Floyd-Warshall algorithm before the node pair distances dk[i,j] satisfy one of the negative cycle detection conditions?

  Data for applications built with modern technologies

1. Provide an example of a software component and another example of a software service. Explain what these examples have in common and how they differ. 2. Consider a legacy system and explain how services could be used to implement wrappers to provi..

  Find the final temperature of the steam

Reconsider Prob. 5-65. Using EES (or other) software, investigate the effect of the exit pressure of steam on the exit temperature after throttling. Let the exit pressure vary from 6 to 1 MPa. Plot the exit temperature of steam against the exit pr..

  Determine the optimum locations to begin development

Your CEO wants to determine the optimum locations to begin development of new sites for 10 more communities in the next two years.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd