Write a program that plots a bar chart for comparing the


Program (graphics)

Write a program that plots a bar chart for comparing the MTBFs of different elevator models.

The data to be displayed is prepared in a file:

• Each line consists of the model's letter and the MTBF that has been measured for that file.

• There will always be at least one line of data in the file.

• There will always be at least one MTBF that is greater than zero.

• Don't assume the letters denoting the models are consec- utive.

file: bar.txt

A

0.66

B

0.50

C

0.72

E

0.43

G

1.55

H

2.00

I

0.67

J

0.54

The data is to be read into the program using the input redirection method used in the previous two problems. For example:

$ java Bar < bar.txt

Sample output is shown in figure1. Your output may be more elaborate or attractive, but it must convey the same data, including the numerical values and the units (years), as a bar chart.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program that plots a bar chart for comparing the
Reference No:- TGS01150147

Now Priced at $30 (50% Discount)

Recommended (95%)

Rated (4.7/5)