Question: In Java 1. Write a program that prompts the user for a positive integer . If the user does not enter a positive integer, keep

In Java

1. Write a program that prompts the user for a positive integer. If the user does not enter a positive integer, keep prompting them (using a WHILE loop) until they enter proper input (so, for example, if they enter -5, it should re-prompt because the value is not positive).

Once the user has entered a positive integer, n, use a FOR loop to output the factorial of n.

Recall, n! = n * (n-1) * (n-2) * ... * 3 * 2 * 1.

2. Write a program that prompts two positive integers m, n from the

console and outputs a multiplication table of the size m x n.

For each row: Print each row with a header of the row number, tab, |, and tab. Print each row with the row number times column number, followed by tab. (Use another for loop). Finally print a new line.

Print Header row: *, tab, |, column umber, tab, column number, tab ..., newline Print s. Hint: Use tabs. Each tab is 8 spaces, so you need to write eight -.

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!