Comp 151 Project 2

Display some Data from a file

Summary:

In this second project you will open a file, and create a very simple visualization, practicing, random, slices and more.

Due:

  Friday Feb 25th at 11:59pm.

As per our in class discussion on Feb 23rd, Since BSU is closed on Friday Feb 25th, I am pushing the due date to Mon Feb 28th at 5pm. That way students can see me in my Monday office hours and See Tyler in the Monday PAL session.

The one downside is you will need to begin reviewing for the midterm while still working on this project

Description:

First create a new project (which creates a new project folder) – use the naming convention from the “Additional Requirements” section below.

  1. ask the user which file to open. store the result in a variable
  2. open the file the user specified. (at this early stage don't do any error handling - we haven't learned it yet)
  3. read in all the lines from the file. The file is in the format below
    1. The first line is the title of the graph
    2. The second line is the x-axis label of the graph
    3. The third line is the y-axis label of the graph
    4. The remaining lines are in this format graph label: size
  4. Open an arcade window
  5. Draw the Title of the graph
  6. draw the x-axis title
  7. draw the y-axis title (you can leave it written horizontally since we haven't covered turning the text vertical. If you want to try, use rotation=90 as your last parameter to draw text)
    1. if these three aren't in perfect locations that is fine as long as they are generally in the right locations.
  8. then slice off the remaining lines from the file and loop through them and draw them centered on the graph. For each line
  9. The number of data lines can be arbitrarily long, but I'll start with about 10 lines. If I have a file with more than 10 and it draws off your window that is fine for this early project (I might enlarge your window on my larger monitor to make sure they all draw)


Sample Data Files

Sample Data File 1

Sample Data File 2


Sample output.

When I ran my solution on the Sample Data File 1, I had this output. I used twice the value from the data line in the file (so for example I read in 200 in the 40-49 age line and multiplied it by 2, so I ended up drawing a 400 pixel wide rectangle.

Instructor demo of project 2

Additional  requirements:

Your code must be commented
Your function must contain all of your code except the one line invoking the function

To help me identify your work, make the name of your project

yourFirstInitialLastNameProject2

(so mine would be JSantoreProject2)
And put the following at the beginning of the program as a comment:



Project Submission

Submit the project by putting it on github as a private project and making me a collaborator as before.


References:

I got the data in the two data files from https://www.census.gov/data-tools/demo/idb/#/pop?COUNTRY_YEAR=2022&COUNTRY_YR_ANIM=2020&FIPS_SINGLE=CH&FIPS=US&popPages=BYAGE&POP_YEARS=2022&menu=popViz&ageGroup=5Y