U4Ch1L11_Functions_Make
Purpose: Students will develop a Quote Making App that leaves it to them to decide how to write the code.
Activity: U4Ch1L11_Level 1: View the Quote Maker App.
Journal
Run the Program – Now answer the following Questions:
Activity: Create A Flowchart of the Quote Maker App
Create The Quote Maker App
Create the Variables:
Create ‘onEvent’;
Update the VariablesIn each ‘onEvent’ that you have written, Update the Variables; this allows the variables to receive new values. Here is an example.
Add ‘setText’ & ‘setProperty’
Depending up whether you are working directly with text (eg. ‘quote’), or in this case, how the text is formatted (eg. Font, color, size), add a ‘setText’ & ‘setProperty’ line of code to each ‘onEvent ‘statement. Here is an example.
The Major Part of The App is Complete – Just Two Segments Remain.
Add ‘if-else’
Finally…Add Functions!
This is the easiest step. Look at the entire program and see which lines of code repeat throughout the program. First, ‘Declare Fx’ and Second ‘Call Fx.’
Hint: I recommend you place the ‘setText’, ‘setProperty’ and ‘if-else’ statements in the ‘Declare Fx’. Remember to place a ‘Call Fx’ in each ‘onEvent’.