程序代写 CS106 W22 – Assignment 04

CS106 W22 – Assignment 04
Due: Friday, February 4, 2022, 11:59 PM Assignment 4 is graded out of 20 marks.
QUESTION ONE:
Question One: Active Covid Cases in Waterloo Region: Requirements and Grading [ 6 marks]

Copyright By PowCoder代写 加微信 powcoder

CS 106 | Winter 2022 | Assignment 04 | Page 1 of 6
There is starter code at: https://openprocessing.org/sketch/1449506 You are to mimic the behavior you see in this video:
https://vault.cs.uwaterloo.ca/s/Lwr3XD228rQStWn
Waterloo Region reports covid data in graphs. Here is a sample graph from Waterloo Region showing new cases by date.
The Ontario government website provides the raw data that is used to create graphs such as the one above. We have downloaded Ontario government data from: https://data.ontario.ca/dataset/status-of-covid-19-cases-in-ontario

For question One, we have a data file with data for Waterloo Region only. It is for the 660 days from April 1 2010 to January 20, 2022. The data file is in the starter code and is named “Waterloo.txt”.
The data file has a header row, and then 660 rows representing the 660 days. Each of the 660 rows has columns showing the following:
• Column 1 is the month
• Column 2 is the day
• Column 3 is the year
• Column 4 is the region’s name
• Column 5 is the region’s number (assigned by the government)
• Column 6 is the number of active cases
• Column 7 is the number of resolved cases
• Column 8 is the number of deaths
We are focusing on column 6, the number of active cases.
You are to write a sketch to plot the Waterloo Region active cases, as shown here and in the video above.
1) [ 4 marks]
o [ 2 marks ] The line on the graph must be drawn correctly.
o [ 2 marks ] You must use beginShape(), vertex(), and endShape() to draw the graph. It doesn’t need to look exactly like the image above exactly, but it must be correct.
CS 106 | Winter 2022 | Assignment 04 | Page 2 of 6

2) [ 2 marks]
• You must have a margin at the top, bottom, left, and right (as in the video and graph above).
• You must have lines on the x-axis and y-axis (as in the video and graph above)
• You must have the title at the top.
• You must have the dates on the x-axis (as in the video and graph above). Also, you must have the numbers “0” and “6000” on the y-axis (as in the video and graph above)
QUESTION TWO:
Question Two: Ontario Active covid cases in all 34 Health Units in Ontario:
Requirements and Grading [ 10 marks]
You are to mimic the behavior you see in this video: https://vault.cs.uwaterloo.ca/s/MjagwwLwHsQpbLL
There is starter code: https://openprocessing.org/sketch/1449504
Here is a video with suggestions on how to proceed. We created it because some students asked for more guidance on how to proceed with coming up with a solution for each assignment. Watch it and see if it is helpful for you. https://vault.cs.uwaterloo.ca/s/J8ajDHwCdgX8Mme
For question Two, we have a data file with data for all 34 Health Units in Ontario. It is for the 660 days from April 1 2010 to January 20, 2022. The data file is in the starter code and is named “Ontario.txt”.
The data file has a header row, and then 22,440 rows representing the 660 days for each of the 34 Health Units (34 times 660 equals 22,440). Each of the 22,440 rows has columns similar to the Ontario.txt data file in Question One above.
• Column 1 is the month
• Column 2 is the day
• Column 3 is the year
• Column 4 is the region’s name
• Column 5 is the region’s number (assigned by the government)
• Column 6 is the number of active cases
• Column 7 is the number of resolved cases
• Column 8 is the number of deaths
CS 106 | Winter 2022 | Assignment 04 | Page 3 of 6

We are focusing on column 6, the number of active cases.
You are to write a sketch to plot the Ontario active cases, as shown here and in the video above.
1) [ 8 marks] The line on the graph must be drawn correctly. You must use beginShape(), vertex(), and endShape() to draw the graph. It doesn’t have to look exactly like the image above exactly, but it must be correct.
• [ 2 marks ] The data for each month must be displayed correctly.
• [ 2 marks ] You must use beginShape(), vertex(), and endShape() to draw the
• [ 2 marks ] Right and left arrows must scroll through each of the 34 regions (as in the video above).
3) [ 2 marks]
• [ 2 marks ] The data and number of active cases must be shown next adjacent to the mouse (as in the video above).
• You must have a margin at the top, bottom, left, and right (as in the video and graph above).
• You must have lines on the x-axis and y-axis (as in the video and graph above)
• You must have the title at the top. The title must show the name of the current
region (as in the video and graph above).
• You must have the dates on the x-axis (as in the video and graph above). Also, you must have the numbers “0” and “10,000” on the y-axis (as in the video and graph above)
CS 106 | Winter 2022 | Assignment 04 | Page 4 of 6

[ 4 marks ] Coding Style and Efficiency
Coding style is evaluated in all sketches.
Follow the on LEARN.
1) 2) 3) 4) 5) 6) 7) 8)
course coding style for whitespace and comments. Consult the “Code Style Guide”
[ 0.5 ] Include your name and student ID number at the beginning of your code. [ 0.5 ] Comment your code appropriately. Avoid superfluous comments.
[ 0.5 ] Correctly and consistently indent your code blocks.
[ 0.5 ] Use correct inline spacing.
[ 0.5 ] Use good line spacing to chunk sections of your code.
[ 0.5 ] All variable names are meaningfully chosen.
[ 0.5 ] No variables are declared but not used.
[ 0.5 ] You may not use any functions or statements not covered in lecture or labs. This includes, but is not limited to:
• No translate(), rotate(), or scale() functions. Restrictions
You may not use any functions or statements not covered in lecture or labs. This includes, but is not limited to:
– No translate(), rotate(), or scale() functions.
Submitting
Use the template file in Word “CS106 Assignment Template” in LEARN (under Assignment 01) to create your Assignment 04 submission for your 2 sketches.
Then convert your Word file to pdf. Please ensure that your URLs are hot links. The TAs need to be able to click on each link in your pdf and go directly to your sketch.
So for example, don’t have a link like this: https://openprocessing.org/sketch/1050954
but rather have that link as a hot link as follows: https://openprocessing.org/sketch/1050954 Ensure that each URL you submit has its settings so that the access is as follows:
CS 106 | Winter 2022 | Assignment 04 | Page 5 of 6

Submit that pdf file to the Assignment 04 dropbox on LEARN.
An example of how to do submit a Lab or Assignment sketch is shown in the following video from
Lab 0: https://vault.cs.uwaterloo.ca/s/MgPD3pBEMjmHQYz
CS 106 | Winter 2022 | Assignment 04 | Page 6 of 6

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com