Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions