Java Bootcamp – Workbooks and Challenges
)}

Workbook 6.13

From the Java Bootcamp Resources, open Workbook 6.13.

6.13.png

Task 1

Create a 2D array of double values that can hold 3 rows and 5 elements per row.

Task 2

Populate your 2D array with values from the following table:

For the sake of exercise, do it the long way (indexing elements one by one).

prices[x][x] = 12.99 prices[x][x] = 8.99 //....

Task 3

Print the prices of each row using this format:

System.out.println("Baking: " + prices[0][0] + " " + prices[0][1] + " "...);

Result

Task 4

Define the array in a single line.

double[][] prices = { {12.99, 8.99, 9.99, 10.49, 11.99}, {0.99, 1.99, 2.49, 1.49, 2.99}, {8.99, 7.99, 9.49, 9.99, 10.99} };

Visualizing the Runtime

After you solve this workbook, I still recommend watching the video solution on Udemy.

13.png

It will show you how to visualize the runtime using Visual Studio Code.


Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer

Feedback Summary
4.7
43 students
5

91%
4

2%
3

0%
2

0%
1

7%
Written Reviews
There are no written reviews yet.