IN JAVA  Arrange the data for your chart in a text file as follows: The first line of the file is the title for the chart The second line of the file is the units used in the chart The rest of the file contains data values for the chart alternating with the label to print with the value on the preceding line. The program must be able to produce a chart from any data file arranged as described above. The name of the data file and the output file are provided on the command line. The program must check that there are enough command line arguments and stop with a suitable message if not. The program saves the chart to the output file (2nd command line argument); it may also display the chart to the terminal, but it is not required to. In addition to the above, accept two additional command line arguments: The maximum width for the chart (just the bar itself, not including the labels) The symbol to use for the bars

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

IN JAVA 

Arrange the data for your chart in a text file as follows:

  • The first line of the file is the title for the chart

  • The second line of the file is the units used in the chart

  • The rest of the file contains data values for the chart alternating with the label to print with the

    value on the preceding line.

    • The program must be able to produce a chart from any data file arranged as described above.

    • The name of the data file and the output file are provided on the command line.

    • The program must check that there are enough command line arguments and stop with a

      suitable message if not. The program saves the chart to the output file (2nd command line argument); it may also display the chart to the terminal, but it is not required to.

      1. In addition to the above, accept two additional command line arguments:

        • The maximum width for the chart (just the bar itself, not including the labels)

        • The symbol to use for the bars

      2.  
This assignment builds on the chart maker app you developed for Problem Set 11. In this stage, the app
will add the capability of reading data from a file to make the chart. For example,
codio@extra-mister:~/workspace$ java ChartMaker_v2 star wars_box_office.dat swboxoffice.txt
Done. Thanks for using the Chart Maker, v2
codio@extra-mister:~/workspace$ cat swboxoffice.txt
--<<== Lifetime Gross Box Office of Star Wars Movies ==>>--
One '=' represents 23,416,556 dollars
============= (307,263,857) Episode IV - A New Hope, 1977
(209, 398,025) Episode V - The Empire Strikes Back, 1980.
(252, 583,617) Episode VI - Return of the Jedi, 1983
(431,088,295) Episode I - The Phantom Menace, 1999
(302,191,252) Episode II - Attack of the Clones, 2002
(380,270,577) Episode III - Revenge of the Sith, 2005
(936, 662,225) Episode VII - The Force Awakens, 2015
(532,177,324) Rogue One: A Star Wars Story, 2016
(620, 181, 382) Episode VIII - The Last Jedi, 2017
(213,767,512) Solo: A Star Wars Story, 2018
(515, 202, 542) Episode IX - The Rise of Skywalker, 2019
========
==========
==================
============
================
===================:
======================
==========================
=========
===========
Arrange the data for your chart in a text file as follows:
●
The first line of the file is the title for the chart
The second line of the file is the units used in the chart
The rest of the file contains data values for the chart alternating with the label to print with the
value on the preceding line.
For example, the data file used to produce the above chart is shown below:
Lifetime Gross Box Office of Star Wars Movies
dollars
307_263_857
Episode IV - A New Hope, 1977
209 398 025
Episode V - The Empire Strikes Back, 1980
252 583 617
Episode VI - Return of the Jedi, 1983
431_088_295
Episode I - The Phantom Menace, 1999.
302 191 252
Episode II - Attack of the Clones, 2002
380_270_577
Episode III
Revenge of the Sith, 2005
936_662_225
Episode VII - The Force Awakens, 2015
532 177 324
Rogue One: A Star Wars Story, 2016
620_181_382
Episode VIII - The Last Jedi, 2017
213_767_512
Solo: A Star Wars Story, 2018
515 202 542
Episode IX - The Rise of Skywalker, 2019
Title for the chart
Units for the chart
Each value for the chart is on
one line and the label for that
value is on the next line
Transcribed Image Text:This assignment builds on the chart maker app you developed for Problem Set 11. In this stage, the app will add the capability of reading data from a file to make the chart. For example, codio@extra-mister:~/workspace$ java ChartMaker_v2 star wars_box_office.dat swboxoffice.txt Done. Thanks for using the Chart Maker, v2 codio@extra-mister:~/workspace$ cat swboxoffice.txt --<<== Lifetime Gross Box Office of Star Wars Movies ==>>-- One '=' represents 23,416,556 dollars ============= (307,263,857) Episode IV - A New Hope, 1977 (209, 398,025) Episode V - The Empire Strikes Back, 1980. (252, 583,617) Episode VI - Return of the Jedi, 1983 (431,088,295) Episode I - The Phantom Menace, 1999 (302,191,252) Episode II - Attack of the Clones, 2002 (380,270,577) Episode III - Revenge of the Sith, 2005 (936, 662,225) Episode VII - The Force Awakens, 2015 (532,177,324) Rogue One: A Star Wars Story, 2016 (620, 181, 382) Episode VIII - The Last Jedi, 2017 (213,767,512) Solo: A Star Wars Story, 2018 (515, 202, 542) Episode IX - The Rise of Skywalker, 2019 ======== ========== ================== ============ ================ ===================: ====================== ========================== ========= =========== Arrange the data for your chart in a text file as follows: ● The first line of the file is the title for the chart The second line of the file is the units used in the chart The rest of the file contains data values for the chart alternating with the label to print with the value on the preceding line. For example, the data file used to produce the above chart is shown below: Lifetime Gross Box Office of Star Wars Movies dollars 307_263_857 Episode IV - A New Hope, 1977 209 398 025 Episode V - The Empire Strikes Back, 1980 252 583 617 Episode VI - Return of the Jedi, 1983 431_088_295 Episode I - The Phantom Menace, 1999. 302 191 252 Episode II - Attack of the Clones, 2002 380_270_577 Episode III Revenge of the Sith, 2005 936_662_225 Episode VII - The Force Awakens, 2015 532 177 324 Rogue One: A Star Wars Story, 2016 620_181_382 Episode VIII - The Last Jedi, 2017 213_767_512 Solo: A Star Wars Story, 2018 515 202 542 Episode IX - The Rise of Skywalker, 2019 Title for the chart Units for the chart Each value for the chart is on one line and the label for that value is on the next line
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education