Unit 4 Lesson 8
Name(s)_______________________________________________ Period ______ Date ___________________
Activity Guide - Conditionals Make |
Step 1 - Try the app
Try making tickets for different combinations of inputs.
Discuss with a Partner
Step 2 - Plan
Variables: Fill in the table below for each variable you'll need to create.
Variable Name | What the Variable Stores |
age | Age of the person |
day | Day of the week |
discountCode | Stores the discount code |
Conditionals: Draw a flowchart that follows the rules below. There's more than one way to do it. Use the table to make sure that your flowchart works for different combinations of age, day, and discount code.
Age | Day | Discount Code | Price |
18 | Monday | none | $5 |
18 | Saturday | none | $10 |
50 | Monday | none | $10 |
50 | Saturday | none | $10 |
18 | Tuesday | FREEFRIDAY | $5 |
50 | Friday | FREEFRIDAY | $0 |
18 | Friday | FREE | $5 |
50 | Friday | FREE | $10 |
Step 3 - Write Your Code
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 | Variables are created and appropriately used for all pieces of information used in the app. | Most information is stored in a variable and appropriately updated throughout the app. | Some information is stored in a variable and appropriately updated throughout the app. | There are no variables which store the necessary information for the app to work correctly. |
Processing: Conditional Logic | The code correctly determines the price for all combinations of inputs (age, price, discount code). | The code correctly determines the price for most but not all combinations of inputs (age, price, discount code). | The code correctly determines the price for some but not all combinations of inputs (age, price, discount code). | The code does not correctly determine the price for any combination of inputs (age, price, discount code). |
Code: Output | The screen correctly displays the day, age, and price of the ticket. | The screen displays most but not all information correctly in the ticket. | The screen displays some but not all information correctly in the ticket. | The screen does not correctly display any information in the ticket. |
Code runs without errors. | No errors are present in the required code. | On 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 conditional logic. | Comments are used to explain the purpose and function of most onEvents and conditional logic. | Comments are used to explain the purpose and function of some onEvents and conditional logic. | Comments are not present. |
Computer Science Principles