CS106 W22 – Assignment 08
Due: Friday, March 18, 11:59 PM
Assignment 8 is graded out of 23 marks. There is no enhancement in this assignment. There is just one sketch to write.
CS 106 | Winter 2022 | Assignment 08 | Page 1 of 3
Copyright By PowCoder代写 加微信 powcoder
You are to create a “weather app”. Your task is to write a sketch to mimic what you see in this video:
https://vault.cs.uwaterloo.ca/s/kgfjzCHTAdG699B
There is starter code at: https://openprocessing.org/sketch/1510907
The starter code loads the forecast a weekly forecast from “forecaast.json”. It is for 8 days, the current day and the next 7 days.
Write a sketch to do the following to mimic what you see in the above video:
The canvas size and background are approximately the same as in the video.
[ 8 marks ] When your sketch starts it shows a line graph of the temperature for today and the next 7 days. It must contain:
1) A heading above the line graph.
2) A line graph showing the temperature for each day (the line must represent the “day”
temperature for each day).
3) Under the line, the actual “day” temperature.
4) Under the line, the month.
5) Under the line, the numeric day of the month.
6) The points on the line should be evenly space and take up most of the canvas (as in the image
and video).
7) The code for doing this must be in a function called “lineGraph()”.
8) At any time, if the user presses “a” or “A” this line Graph should appear.
[ 7 marks] At any time, the user types a digit between 0 and 7 then they see statistics for that day. If they press “0”, that means today. If they press “1” that means tomorrow (i.e. 1 day from today). If they press “2” that means two days from now, and so on up to “7”. The statistics contain:
1) A heading at the top.
2) Day forecast temperature for the day.
3) Min forecast temperature for the day.
4) Max forecast temperature for the day.
5) “Main” forecast “main” for the day.
6) Forecast description for the day.
7) The code for doing this must be in a function called “statistics()”
[ 4 marks ] When the sketch starts it should print the following to the console. All of the “main” and “description” for any “main” that begin with “Cl”. You must do this in a function called “consoleStuff()”. See the video.
[ 4 marks ] Coding Style and Efficiency
Coding style is evaluated in all sketches.
Follow the course coding style for whitespace and comments. Consult the “Code Style Guide” on LEARN.
1) [ 0.5 ] Include your name and student ID number at the beginning of your code.
2) [ 0.5 ] Comment your code appropriately. Avoid superfluous comments.
3) [ 0.5 ] Correctly and consistently indent your code blocks.
4) [ 0.5 ] Use correct inline spacing.
5) [ 0.5 ] Use good line spacing to chunk sections of your code.
6) [ 0.5 ] All variable names are meaningfully chosen.
7) [ 0.5 ] No variables are declared but not used.
8) [ 0.5 ] You may not use any functions or statements not covered in lecture or labs. This
includes, but is not limited to:
CS 106 | Winter 2022 | Assignment 08 | Page 2 of 3
• 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 08 submission for your sketch.
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:
Submit that pdf file to the Assignment 08 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 08 | Page 3 of 3
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com