Question
program is java //2) Method drawParallelogram() draws a parallelogram figure with //'width' specified as parameter. Draw lines,each indented 2 //spaces farther to right than the
program is java
//2) Method drawParallelogram() draws a parallelogram figure with
//'width' specified as parameter. Draw lines,each indented 2
//spaces farther to right than the previous line. Continue drawing
//new lines until the last line starts at a position one greater
//that the ending position of the first line. Hard code '*' for
//line characters. Hint: Use two different loops. Let the first
//for loop construct a trapezoid line( type String) of length
//width. Then use this line in a second indefinite while() loop
//to draw parallelogram lines. Draw lines in the while() loop
//while the length of the line(line.length) is greater than the
//number of indentation spaces for the next line. Increment # of
//indentation spaces by 2 each iteration. Use the String method
//length() to keep track of the number of indentation spaces.
//Initially set String spaces = ??, to empty.
//
// **********
// **********
// **********
// **********
// **********
// **********
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started