Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to draw wine glasses separated by a blank line; there are two key parameters for this: the number of wine glasses to

Write a program to draw wine glasses separated by a blank line; there are two key
parameters for this: the number of wine glasses to draw, and the size of the glasses.
Define these values in main; for optional extra credit, prompt the user for the values.
The program must define three methods to draw the various parts of a wine glass,
the flute, the stem, and the base of the glass; each will receive the wine glass size.
Drawing the glasses should be done from main by calling a fourth method,
drawGlasses
(
number
,
size
)
-
have main call that at least twice with different inputs.
Your methods can assume that the number of wine glasses to draw is
0
or greater,
and that the size of the wine glasses is always an odd number greater than
2
Here are example outputs when the number of glasses is
2
and their size is
3
or
5
:
Think Before Programming!
Count the number of stars and
spaces carefully for each size!
Include pseudocode for the
program and methods you write. in Write a program to draw wine glasses separated by a blank line; there are two key
parameters for this: the number of wine glasses to draw, and the size of the glasses.
Define these values in main; for optional extra credit, prompt the user for the values.
The program must define three methods to draw the various parts of a wine glass,
the flute, the stem, and the base of the glass; each will receive the wine glass size.
Drawing the glasses should be done from main by calling a fourth method,
drawGlasses(number, size)- have main call that at least twice with different inputs.
Your methods can assume that the number of wine glasses to draw is 0 or greater,
and that the size of the wine glasses is always an odd number greater than 2
Here are example outputs when the number of glasses is 2 and their size is 3 or 5 :
Think Before Programming!
Count the number of stars and
spaces carefully for each size!
Include pseudocode for the
program and methods you write.java
image text in transcribed

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

More Books

Students also viewed these Databases questions