vendredi 19 février 2021

Input and output files, program lab

  1. Read the file DLS_L5_Lastname.txt made above. If the file is not found, handle the situation appropriately with a good error message, including the name of the file not found, then stop. Do not attempt to display a chart if no data is available. If the file opens OK, read the name of the town. At the top, display a title so the user knows what this chart represents. Use toupper on each letter of the name so the name is fully uppercase. For example, display: ABERNATHY POPULATION GROWTH (each * represents 1000 people)

  2. Use all the data in the file to display a bar chart showing population growth. (max 16 points).

  3. Make the program more flexible: read population values from the file until end-of-file (instead of 7 times). It should work if there are more or less than 7 population values. Handle population values until end of file. (max 20 points). Example output: (bar chart) MINDOBIZ POPULATION GROWTH (each * represents 1000 people) 1900 ******* 1920 ********* 1940 *** 1960 ** 1980 ********* 2000 ********* 2020 *

I will use your data file for testing. Your program should contain your test results at the bottom in a comment.

You program can assume: 1) population numbers start at the year 1900 (or 1910); (some textbook editions start at 1900, some start at 1910; it doesn't really matter) 2) population counts are provided in 20 year increments; 3) seven population counts provided. For working code that reads data from a file, see: "Program Samples", Simple FileIO. This provides a complete, working FileIO example.

I dont want yall anyone to solve it just need more of an explanation on how i can work it, my professor isnt the best at explaining and I'm tired of watching youtube videos.

Aucun commentaire:

Enregistrer un commentaire