Write a JAVA program that reads the height of a triangle (less than 10) from the user and then calls two void methods named plotTril and plotTri2. Each of the 2 methods should have a parameter for the height of the triangle and use printf inside of nested For loops to produce the output of the respective triangle for the user. Note that the numbers in the triangle are left-aligned.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
X
123.pdf
F6
1 / 3 | -
F7
&
1
724
Write a JAVA program that reads the height of a triangle (less than 10) from the user and then
calls two void methods named plot Tril and plotTri2. Each of the 2 methods should
have a parameter for the height of the triangle and use printf inside of nested For loops to
produce the output of the respective triangle for the user. Note that the numbers in the
triangle are left-aligned.
Create a project and class named HW8FirstnameLastname in NetBeans using your actual first
and last names to hold your program.
For height = 8, plotTril and plotTri2 will print the following triangles respectively.
Bb 19534869
72
F8
1
*
100% +
124
2 1
8
4
2
16
8
4
32
16
8
64 32
16
128 64
32
64
32
16
32
16
8
16
8
4
8
4
2
1 2 4 8
1
248 P
1
2
4
8
00
16
8
4
2
1
1
2
F9
4
00
16
ANP
1
2
8
72
ELL
1
8
16
32
4 2
ΕΝΝΕ
4
2 1
1
1
727
prt sc
2 1
727
F10
4
4
8
8
16
16 32
32
64
1
72
1
X
1
2
4
1
8
2 1
16
4
64 32
16 8
128 64 32 16
H
home
b Home | bartleby
F11
1
2
4
end
248
F12
1
2
4
+
x + +
1
2 1
insert
delete
CE
Transcribed Image Text:X 123.pdf F6 1 / 3 | - F7 & 1 724 Write a JAVA program that reads the height of a triangle (less than 10) from the user and then calls two void methods named plot Tril and plotTri2. Each of the 2 methods should have a parameter for the height of the triangle and use printf inside of nested For loops to produce the output of the respective triangle for the user. Note that the numbers in the triangle are left-aligned. Create a project and class named HW8FirstnameLastname in NetBeans using your actual first and last names to hold your program. For height = 8, plotTril and plotTri2 will print the following triangles respectively. Bb 19534869 72 F8 1 * 100% + 124 2 1 8 4 2 16 8 4 32 16 8 64 32 16 128 64 32 64 32 16 32 16 8 16 8 4 8 4 2 1 2 4 8 1 248 P 1 2 4 8 00 16 8 4 2 1 1 2 F9 4 00 16 ANP 1 2 8 72 ELL 1 8 16 32 4 2 ΕΝΝΕ 4 2 1 1 1 727 prt sc 2 1 727 F10 4 4 8 8 16 16 32 32 64 1 72 1 X 1 2 4 1 8 2 1 16 4 64 32 16 8 128 64 32 16 H home b Home | bartleby F11 1 2 4 end 248 F12 1 2 4 + x + + 1 2 1 insert delete CE
df
30
F5
%
5
X
T
123.pdf
F6
3
Y
F7
trangle are feit-angned.
&
7
1 / 3 | - 100%
1
Create a project and class named HW8FirstnameLastname in NetBeans using your actual first
and last names to hold your program.
For height = 8, plotTril and plotTri2 will print the following triangles respectively.
2
4
8
1
24
26
127
4
X
1
2
16
8
32
16
64 32
128 64
64
32
16
8
4
12
427
Bb 19534869
1
F8
*
8
1
8
16
32
32 16
16 8
8
4
2
4
1
2
4
PN
2
1
1
27
4
8
HET H
1
4
8
2 1
CO
+1
2
ΕΝ
1
2
1
8
8
16
16 32
84400 ANT
F9
9
727
U
DO
1 2
16
8
4 2 1
4
1
DELL
2 1
TENH
124
2
2
8
16
32
64
prt sc
O
24 CO
F10
121
xb Home | bartleby
124
8
16
8
32
16
64 32
128 64
O
1
1
P
77
2
4
8
16
32
home
F11
12
4
8
16
1
2
4
8
1
{
[
2
4
end
F12)
1
2
+ 11
1
insert
}
X +
]
delete
backspace
num
lock
G ^ ( 4 )
7
home
0
+ 6
CE
1
E
7:06 PM
11/4/20
8
Transcribed Image Text:df 30 F5 % 5 X T 123.pdf F6 3 Y F7 trangle are feit-angned. & 7 1 / 3 | - 100% 1 Create a project and class named HW8FirstnameLastname in NetBeans using your actual first and last names to hold your program. For height = 8, plotTril and plotTri2 will print the following triangles respectively. 2 4 8 1 24 26 127 4 X 1 2 16 8 32 16 64 32 128 64 64 32 16 8 4 12 427 Bb 19534869 1 F8 * 8 1 8 16 32 32 16 16 8 8 4 2 4 1 2 4 PN 2 1 1 27 4 8 HET H 1 4 8 2 1 CO +1 2 ΕΝ 1 2 1 8 8 16 16 32 84400 ANT F9 9 727 U DO 1 2 16 8 4 2 1 4 1 DELL 2 1 TENH 124 2 2 8 16 32 64 prt sc O 24 CO F10 121 xb Home | bartleby 124 8 16 8 32 16 64 32 128 64 O 1 1 P 77 2 4 8 16 32 home F11 12 4 8 16 1 2 4 8 1 { [ 2 4 end F12) 1 2 + 11 1 insert } X + ] delete backspace num lock G ^ ( 4 ) 7 home 0 + 6 CE 1 E 7:06 PM 11/4/20 8
Expert Solution
steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education