Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Define Administration?

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago