Workbook 6.13 (Revisited)
Re-write your print logic from Workbook 6.13 to use a nested loop.
Outer Loop
switch (i) { case 0: System.out.print("Baking: "); break; case 1: System.out.print("Beverage: "); break; case 2: System.out.print("Cereals: "); break; }
Inner Loop
System.out.print(prices[i][j] + " ");
After the inner loop runs to completion, print a new line.
System.out.print("\n");
Final Result
Visualizing the Runtime
After you solve this workbook, I still recommend watching the video solution on Udemy.
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.