Post date: Oct 11, 2018 8:22:32 AM
/!\ Midterm Practical will be on the second class
Flow of Control
3.3 Loops (for / nested loops)
Recommended Self-Test Exercises:
p 178-179: Ex. 28, 29, 31-33, and 35-39.
Lab Exercise:
Write a Java program that displays the following output:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Print following structures in Java using nested loops by asking the user to give you the size of the structure:
# # # # #
# #
# #
# #
# # # # #
# # # #
# #
# #
# # # #
Write a program that displays all the prime number less than 1000. A prime number is a number that can only be divided by itself and by 1.
Print each of the following patterns using nested loops:
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (a) (b) (c) (d) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (e) (f) (g) (h) (i)