public static String getFlag(int size, char color1, char color2, char color3) - This method returns a string where a triangle appears on the left size of the diagram, followed by horizontal lines. For example, calling DrawingApp.getFlag(9, 'R', '.', 'Y'); will generate the string: R.. RRYYYYYYY YYYYYYYYYYYYYYY YYYYYYYYY RRRYYYYYYY YYYYYYYYYYYYYY YYYYYYYYY RRRRYYY YYYYYYYYY ΥΥΥΥΥΥΥΥΥΥΥ RRRRRYYYYYYY' ΥΥΥΥΥΥΥΥΥΥΥΥΥΥ ΥΥΥΥΥΥΥΥ RRRRRRYYYY ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ ΥΥΥΥΥΥΥΥ RRRRRRRYYYYYYY ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ YYYYYYYYY RRRRRRRRYY ΥΥΥΥΥΥΥΥΥΥΥΥ YYYYYYYYY RRRRRRRRR. ...... RRRRRRRRR. RRRRRRRRY YYYYYYYY YYYYYYYYY RRRRRRRYYY ΥΥΥΥΥΥΥΥΥΥΥ ΥΥΥΥΥΥΥΥ RRRRRRYYYY YYYYYYYYYYYYYYY YYYYYYYYY RRRRRYYYYY YYYYYYYYYYYYYYYYY YYYYYYYYY RRRRYYYYYY YYYYYYYYYYYYYY YYYYYYYYY RRRYYYY YYYYYYYYYYY YYYYYYYYY RRYYYYYYYYYYY YYYYYYYYYYYYYYY ΥΥΥΥΥΥΥΥ R.. The diagram has a number of rows that corresponds to size * 2 and a number of colums that corresponds to size * 5. The first and last row will use color2 (except for the first character that will use color1). The center two rows will use color2 and the rest color3. The triangle will rely on color1 and will have a height corresponding to size * 2. If the size parameter is less than three, the method will return null and will not generate any diagram. For this method you can assume the colors are valid. The method MUST not rely on System.out.printin).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
5. public static String getFlag(int size, char
color1, char color2, char color3) - This method
returns a string where a triangle appears on the
left size of the diagram, followed by horizontal
lines. For example, calling
DrawingApp.getFlag(9, 'R', '.', 'Y'); will generate
the string:
R...
RRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRYYYYΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ
YYYYYYYYY
RRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRRRYYYYY
YYYYYYYYYYYYY
YYYYYYYYY
RRRRRRY
YYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRRRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRRRRRRYY
YYYYYYYYYYYYYYYY
YYYYYYYYY
RRRRRRRRR.
RRRRRRRRR.
RRRRRRRRYYYYYY
rҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮ
YYYYYYYYY
RRRRRRRYYY
ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ
ΥΥΥΥΥΥΥΥΥ
RRRRRRYYY
ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ
YYYYYYYYY
RRRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYY
RRYYYYYYYY
YYYYYYYYYYYYYYYY
ΥΥΥΥΥΥΥ
The diagram has a number of rows that
corresponds to size * 2 and a number of colums
that corresponds to size * 5. The first and last
row will use color2 (except for the first character
that will use color1). The center two rows will
use color2 and the rest color3. The triangle will
rely on color1 and will have a height
corresponding to size * 2. If the size parameter
is less than three, the method will return null and
will not generate any diagram. For this method
you can assume the colors are valid. The
method MUST not rely on System.out.println(.
Transcribed Image Text:5. public static String getFlag(int size, char color1, char color2, char color3) - This method returns a string where a triangle appears on the left size of the diagram, followed by horizontal lines. For example, calling DrawingApp.getFlag(9, 'R', '.', 'Y'); will generate the string: R... RRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRRYYYYΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ YYYYYYYYY RRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRRRRYYYYY YYYYYYYYYYYYY YYYYYYYYY RRRRRRY YYYYYYYYYYYYYYYYY YYYYYYYYY RRRRRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRRRRRRRYY YYYYYYYYYYYYYYYY YYYYYYYYY RRRRRRRRR. RRRRRRRRR. RRRRRRRRYYYYYY rҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮҮ YYYYYYYYY RRRRRRRYYY ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ ΥΥΥΥΥΥΥΥΥ RRRRRRYYY ΥΥΥΥΥΥΥΥΥΥΥΥΥΥΥ YYYYYYYYY RRRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRRYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYY RRYYYYYYYY YYYYYYYYYYYYYYYY ΥΥΥΥΥΥΥ The diagram has a number of rows that corresponds to size * 2 and a number of colums that corresponds to size * 5. The first and last row will use color2 (except for the first character that will use color1). The center two rows will use color2 and the rest color3. The triangle will rely on color1 and will have a height corresponding to size * 2. If the size parameter is less than three, the method will return null and will not generate any diagram. For this method you can assume the colors are valid. The method MUST not rely on System.out.println(.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY