Pierce College Weather Forecasting Code Org Programming

Instructions Attached

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Unit 5 Lesson 12
Name(s)_______________________________________________ Period ______ Date ___________________
Activity Guide – Traversals Make
Step 1 – Try the app
● Click on “Get Forecast”
● Click the button several times to see how the
display changes
Discuss with a Partner
● What information is needed to create this app?
● What list filtering patterns might be used?
Step 2 – Plan
Lists: ​This app uses the ​Daily Weather ​table. Open the data tab and click on the table. Which columns do you think
you will use in this app? The columns will be stored as lists in your program. There are ​6 columns ​used in this app.
Column
Name of List
What is stored
City
cityList
A list of cities
Forecast Number
forecastNumberList
The number of days from today (for example: 1 = tomorrow)
conditionList
Filtered Lists:​ What lists will be filtered? What list will be used to filter these lists? Remember, we want to only display
the forecast for tomorrow. There are ​5 filtered lists ​and one list which is traversed to filter the other lists.
Original List
Filtered List
cityList
filteredCityList
conditionList
filteredConditionList
Computer Science Principles
Filtered by
1
Unit 5 Lesson 12
Traversal: ​Review the ​List Filter Pattern: Filtering Multiple Lists​. Consider how you will use this in your app.
All the lists must be the same length for
this pattern – ideally they are columns
pulled from a table
How does it work?





Create a variable for each list
Create blank lists to store the
filtered lists
In a function, first reset all
filtered lists to blank lists. Every
time the function is called, the
filtered lists will reset.
Use a for loop to access each
item in the list that contains the
element you are filtering by
If the element is found, append
to each filtered list the element
at the index in the original lists
where the element was found
Output: ​Think about a function that updates the screen. This app displays a random city’s forecast. How will the
random city be selected? How will that information be used to display data from the filtered lists?
How will the random city be selected:
How will that information be used to display data from the filtered lists:
Computer Science Principles
2
Unit 5 Lesson 12
Step 3 – Write Your Code
● Write the code for the app, using your plan above and the comments provided in Code Studio to help
● Steps you can follow:
○ Create all the lists from your tables above.
○ Give your variables a starting value using the assignment operator (=). For lists that are created from
columns in the table, use ​getColumn()​ to populate the lists.
○ Create a function to filter the lists. Refer to the List Filter Pattern.
○ Create a function that updates the screen.
○ Update the output elements on the screen inside of the function that updates the screen.
○ Create an ​onEvent() ​for the user input and call the function that updates the screen.
○ Use your debugging skills to identify unexpected behavior and fix your program
○ Comment your code as you go, explaining what each event handler and function does
● Extension Ideas
○ Add sound to indicate what the weather will be. For example, you can add a brief rain sound if it is
rainy or a clip from a song talking about sunshine if it is going to be a sunny day.
○ Create an algorithm that would judge the weather in some way. For example, you might be able to tell
a user if the weather was good weather for a specific activity such as going for a run outside.
Step 4 – Submit
Before your submit check the rubric below to make sure your program
Category
Extensive Evidence
Convincing Evidence
Limited Evidence
No Evidence
Input
onEvents are created for
all the required inputs.
onEvents are created
for most of the inputs.
onEvents are created
for some of the inputs.
onEvents are not
created for any
inputs.
Storage:
Variables
and Lists
Variables and lists are
created and
appropriately used for all
pieces of information
used in the app.
Variables and lists are
created and
appropriately used for
most pieces of
information used in the
app.
Some information is
stored in variables and
lists and appropriately
updated throughout the
app.
There are no
variables or lists
which store the
necessary
information for the
app to work correctly.
Processing:
Lists
The program correctly
processes the list for all
user interface elements.
The program correctly
processes the list for
most user interface
elements.
The program correctly
processes the list for
some of the user
interface elements.
The program does
not include or does
not process a list.
Code:
Functions
A function is used which
correctly updates all
output elements. The
function is called in the
appropriate onEvents.
A function is used
which correctly
updates most of the
output elements. The
function is called in the
appropriate onEvents.
A function is used
which updates some of
the output elements or
the function is only
called in some of the
appropriate onEvents.
There is no function
which updates the
screen.
Output
The screen correctly
displays a random city’s
forecast.
The screen displays
most of a random city’s
forecast.
The screen displays
some of a random
city’s forecast.
The screen does not
correctly display any
of a random city’s
forecast.
Code runs
without errors
No errors are present in
the required code.
One or two errors are
present in the required
code.
Three or four errors are
present in the required
code.
More than four errors
are present in the
required code.
Coding
Comments
Comments are used to
correctly explain the
purpose and function of
all onEvents and
functions.
Comments are used to
explain the purpose
and function of most
onEvents and
functions.
Comments are used to
explain the purpose
and function of some
onEvents and
functions.
Comments are not
present.
Computer Science Principles
3
Unit 5 Lesson 12
Computer Science Principles
4
4. Lesson 12: Traversals Make (40 minutes estimate)
• Practice making an app that processes a list from a data set using a traversal
3. Create the Random Forecaster App in Lesson 12 of Unit 5 using this activity_guide v.
4. Check the rubric in the activity guide (and below) to make sure all is completed.
5. Take a screenshot of your finished program and insert into your 9.4Traversals document.
6. Take a screenshot of your code in the text view (click the Show Text button in the top right) and insert
into your 9.4Traversals document.
7. Record your working app, using a program that allows you to share your presentation with your teacher
through a link, such as Screencastify, Screencast-o-matic, etc, to record your computer screen.
o A video recording of your working app is part of your official Create PT.
o Follow the requirements for the video recording located on page 193 of the AP Computer
Science Principles Course and Exam Description (CED) .
o You will not upload the video to this dropbox.
o Do NOT post your schoolwork to a public forum like YouTube, please.
o Add the link to your shared presentation to your 9.4Traversals document.
8. Add the activity guide and your screenshot into one document.
9. Save/download/export your 9.4Traversals document as a pdf.
.O. Submit your pdf to this assignment dropbox.
Your Activity 9.4 will be graded according to the following:
Rubric – 21 points
Extensive Evidence
Limited Evidence
No Evidence
Category
Convincing Evidence
2 pts
3 pts
1 pt
Opt
on Events are created for
onEvents are defined for onEvents are created for
Input
onEvents are not created
for any inputs
all the required inputs
most of the inputs
some of the inputs
Variables and lists are
created and
Some information is stored There are no variables or
Storage: Variables and
Variables and lists are
created and appropriately
used for all pieces of
information used in the
lists which store the
Lists
appropriately used for in variables and lists and
most pieces of
appropriately updated
information used in the throughout the app
necessary information for
the app to work correctly
app
app
The program correctly
The program correctly
The program correctly
The program does not
processes the list for
processes the list for some
Processing: Lists
processes the list for all
include or does not
most user interface
of the user interface
user interface elements
process a list
elements
element
A function is used which A function is used which
A function is used which
correctadatocall

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER