Question: Ex1. Write a program (Ex1.java) to display the following patterns. (Only nested loops allowed) # # # # # # # # # # #

Ex1. Write a program (Ex1.java) to display the following patterns. (Only nested loops allowed)

#

# #

# # #

# # # #

# # # # #

Ex2. Write a program (Ex2.java) to display the following patterns. (Only nested loops allowed)

# # # # #

# # # #

# # #

# #

#

Ex3. Write a program (Ex3.java) to display the following patterns. (Only nested loops allowed)

# # # # #

# # # #

# # #

# #

#

Ex4. Write a program (Ex4.java) to display following tables. (Only nested loops allowed)

1 2 3 4 5

2 4 6 8 10

3 6 9 12 15

4 8 12 16 20

5 10 15 20 25

Ex5. Write a program (Ex5.java) to play the game of "Guessing Number" again. Firstly, use Random generator to generate a number(0-9), then let the user input a guess, if they are the same, print "Congratulations! You win!". Otherwise, print "You lose." The user has at most three chances per game! (Note that do not change the generated random number before the user hits it)

Ex6. Write a program (Ex6.java) to read 10 values from the user and print the lowest and highest value entered.

Example:

Inputs: 1 3 5 7 9 10 8 6 4 2

Output:

The lowest value: 1

The highest value: 10

Ex7. Write a program (Ex7.java) to find the Nth number in Fibonacci sequence.

A Fibonacci sequence is defined as follow:

- The first two numbers are 0 and 1.

- The i th number is the sum of i-1 th number and i-2 th number.

The first ten numbers in Fibonacci sequence is:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!