SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,kenrick Mock
Chapter:
Swing Ii
Exercise:
Programming Projects
Question:8 | ISBN:9780132830317 | Edition: 5

Question

Write a program that graphically displays a vertical bar chart. The input is an array of integers. Use the index of an array entry as the label on the X axis. The height of the bar should correspond to the value of the array entry. Scale the height proportionally so the bar chart fits on the screen. For example, if the array values are {3000, 4000, 5000}, then the bars should not be drawn 3,000; 4,000; and 5,000 pixels tall. Instead they should fit on the screen but remain in the correct proportion to the original values (e.g., perhaps 300, 400, and 500 pixels tall, but the actual values will depend upon the size of your window).


TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.