java code question !!

Oct 12th, 2014
HelloWorld
Category:
Calculus
Price: $50 USD

Question description

(Display four patterns using loops) Ask the user to enter an integer  to
set a limit for nested loops and generate the following four patterns:

Enter an integer  to be a limit of the pattern:6
Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 5 6 

Pattern B:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 
6 5 4 3 2 1 

Pattern D:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

SAMPLE RUN #1

--- Prompts For Keyboard/Console/Standard Input ---

Enter an integer  to be a limit of the pattern:

Inputs

--- Keyboard/Console/Standard Input stdin ---

4 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter an integer  to be a limit of the pattern:Pattern A:

1 2 
1 2 3 
1 2 3 4 

Pattern B:
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 

Pattern D:
1 2 3 4 
1 2 3 
1 2 

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LoopPattern 
Enter an integer  to be a limit of the pattern: 4 
Pattern A:

1 2 
1 2 3 
1 2 3 4 

Pattern B:
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 

Pattern D:
1 2 3 4 
1 2 3 
1 2 

SAMPLE RUN #2

--- Prompts For Keyboard/Console/Standard Input ---

Enter an integer  to be a limit of the pattern:

Inputs

--- Keyboard/Console/Standard Input stdin ---

6 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter an integer  to be a limit of the pattern:Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 5 6 

Pattern B:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 
6 5 4 3 2 1 

Pattern D:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LoopPattern 
Enter an integer  to be a limit of the pattern: 6 
Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 5 6 

Pattern B:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 
6 5 4 3 2 1 

Pattern D:
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

SAMPLE RUN #3

--- Prompts For Keyboard/Console/Standard Input ---

Enter an integer  to be a limit of the pattern:

Inputs

--- Keyboard/Console/Standard Input stdin ---

8 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter an integer  to be a limit of the pattern:Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 5 6 
1 2 3 4 5 6 7 
1 2 3 4 5 6 7 8 

Pattern B:
1 2 3 4 5 6 7 8 
1 2 3 4 5 6 7 
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 
6 5 4 3 2 1 
7 6 5 4 3 2 1 
8 7 6 5 4 3 2 1 

Pattern D:
1 2 3 4 5 6 7 8 
1 2 3 4 5 6 7 
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LoopPattern 
Enter an integer  to be a limit of the pattern: 8 
Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 
1 2 3 4 5 6 
1 2 3 4 5 6 7 
1 2 3 4 5 6 7 8 

Pattern B:
1 2 3 4 5 6 7 8 
1 2 3 4 5 6 7 
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 
6 5 4 3 2 1 
7 6 5 4 3 2 1 
8 7 6 5 4 3 2 1 

Pattern D:
1 2 3 4 5 6 7 8 
1 2 3 4 5 6 7 
1 2 3 4 5 6 
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

SAMPLE RUN #4

--- Prompts For Keyboard/Console/Standard Input ---

Enter an integer  to be a limit of the pattern:

Inputs

--- Keyboard/Console/Standard Input stdin ---

5 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter an integer  to be a limit of the pattern:Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 

Pattern B:
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 

Pattern D:
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LoopPattern 
Enter an integer  to be a limit of the pattern: 5 
Pattern A:

1 2 
1 2 3 
1 2 3 4 
1 2 3 4 5 

Pattern B:
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 


Pattern C:

2 1 
3 2 1 
4 3 2 1 
5 4 3 2 1 

Pattern D:
1 2 3 4 5 
1 2 3 4 
1 2 3 
1 2 

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UIUC
PREMIUM TUTOR

Studypool has helped 1,244,100 students

Summary
Quality
Communication
On Time
Value
Five Star Tutor
Mar 24th, 2017
" Outstanding Job!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1819 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors