Java Bootcamp – Workbooks and Challenges
)}

Workbook 6.9

From Java Bootcamp Resources -> Module 1 -> 6. Arrays, open Workbook 6.9.

Taxes

Timmy went to the Java Grocer and bought four items at these prices:

1.99 -- 2.99 -- 3.99 -- 4.99

He would like to know what the prices are after-tax. Since you're the Java Grocer's best cashier, they want you to build a program that updates the prices after-tax.

Task 1


Inside main, an array stores each price. Create a new array afterTax with the same length.

Task 2


In the Java world, the tax rate is 13%. Use a for loop to update each element in afterTax to be: price + 13% * price .

Task 3


Print the following messages:

The original prices are: <original prices>

The prices after tax are: <after tax prices>

Use Arrays.toString to print the arrays.

Good Luck!

Feedback Summary
4.8
38 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.