Question: Make a basic complete Java program called CalcTotalPrice according to the following guidelines. The program must include five methods: printSale, getSalePrice, getSaleWeight, calcTax, and calcShipping.

Make a basic complete Java program called CalcTotalPrice according to the following guidelines.

The program must include five methods: printSale, getSalePrice, getSaleWeight, calcTax, and calcShipping.

The method printSale takes no input parameters and has a return type of void; it prints values by by calling the other four methods and computing the sale total.

The methods getSalePrice and getSaleWeight each return a double, which they get from user input.

The method calcTax takes a double (the sale price) as a parameter and returns a double that is the amount of tax (use 6% as a fixed tax rate).

The method calcShipping takes a double (the sale weight) as a parameter and returns the shipping amount as a double (calculate shipping as $10 if weight is less than 10, and $20 if weight is 10 or greater).

The method printSale should print the sale price amount, tax amount, shipping amount, and sale total amount (sale price plus tax and shipping).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!