Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java, you are going to write a program to create a histogram. A histogram draws bars that represent the values of different categories. For

Using Java, you are going to write a program to create a histogram. A histogram draws bars that represent the values of different categories. For example:

Favorite color of CSE students

Blue @@@@@@@

Green @@@@@@@@@@@@

Red @@@@@

Silver @

Yellow @@@

Create a Project called Lab6 and Class named Histogram

Write methods to do the following:

public static void drawBar(int n) Prints a row of @ (length n)

public static void drawItem(String s, int n) Prints the string s, followed by a bar of length n

public static void drawHistogram(String title, String[] items, int[] values) Prints the entire histogram with a title. Note that the items and values are arrays.

Then use the main() method to initialize the arrays and print the histogram at the beginning of this lab. Recall that you can declare and initialize an array in a single statement.

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago