Java Bootcamp – Workbooks and Challenges
)}

Workbook 6.8

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

Receipt

You've been promoted to cashier at the Java Grocer. They want you to build a Java program that prints a receipt.

Task 1


Jim bought three apples: Gala, Granny Smith, and Macintosh. Respectively, each apple was worth: 1.99, 1.49, and 1.29.

  • Create an array that stores the apples Jim bought.

  • Create another array that stores the price of each apple.

Task 2


After printing: Here's your receipt\n, use a for loop to print each apple and the corresponding price:

\t<apple i >: $ <price i >

Good Luck!

Feedback Summary
4.8
39 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.