0% found this document useful (0 votes)
16 views10 pages

If and Nested Statements

The document discusses using if and nested if statements in Python programming. It provides examples of tasks to create simple scripts that use logical tests and if statements, including determining employee type based on hours worked, calculating reorder amounts based on stock levels, setting sales targets based on brand, and calculating employee pay and student grades.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views10 pages

If and Nested Statements

The document discusses using if and nested if statements in Python programming. It provides examples of tasks to create simple scripts that use logical tests and if statements, including determining employee type based on hours worked, calculating reorder amounts based on stock levels, setting sales targets based on brand, and calculating employee pay and student grades.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Simple Programming

Programming

If and Nested Statements

http://www.yahmad.co.uk/
Unit Overview
Objectives
Understand why computer programming scripts are used.
Understand the use of Variables as place holders for information.
Understand the use of if and nested if statements in Python Programming.
Programming

Outcomes Time
Task 1 Job Type
Task 2 Stock Level
Task 3 Sales Target
Task 4 Employee Pay
Task 5 Grades
Task 6 Extension

http://www.yahmad.co.uk/
IF/Nested Overview
1. Simple script to work whether employees are part time or fulltime.
2. Logical Test: Worked Hours less than 15
3. True: “You are a part time employee”
4. False: “You are a full time employee”
Programming

Logical Test

IF Statement: True

IF Statement: False

Logical Test

1. IF Statement: True
2. IF Statement: True

IF Statement: False
Task 1 – Job Type
1. Create a simple script to work whether employees are part time or fulltime.
2. Logical Test: Worked Hours less than 15
3. True: “You are a part time employee”
4. False: “You are a full time employee”
Programming

http://www.yahmad.co.uk/
Task 2 – Stock Level

1. Create a simple script to work the reorder amount for the Maze Runner Book.
2. Logical Test: Stock Level <1, True: “reorder 20”
3. Logical Test: Stock Level <5, True: “reorder 15”
4. Logical Test: Stock Level <10, True: “reorder 10”
5. False: “Fully Stocked”
Programming
Task 3 – Sales Target

1. Create a simple script to work the sales target.


2. Logical Test: brand == Apple , True: Sales = 10
3. Logical Test: brand == Samsung, True: Sales = 15
4. Logical Test: brand == Nokia , True: Sales = 20
Programming

5. False: Sales = 25

http://www.yahmad.co.uk/
Task 4 – Employee Weekly Pay

1. Create a simple script to work employees weekly salary.


2. Job Type: Less than 15 hours (Part Time), 15 Hours or More (Full Time)
3. Rate of Pay: Part Time (£5), Full Time (£10)
4. Weekly Pay: Hours * Rate of Pay (FT or PT)
Programming

http://www.yahmad.co.uk/
Task 5 – Grades

1. Create a simple script to work out the pupils grade.


2. Create two variables to contain the pupils name and grade out of 100.
Checking Grade Variable
Programming

1st True Statement


>90, A* Grade
2nd True Statement
>80, A Grade
3rd True Statement
>70, B Grade
4th True Statement
>60, C Grade
5th True Statement
>50, D Grade
False: anything less than 50 - Fail

http://www.yahmad.co.uk/
Task 6 - Extension

Can you make your own


program containing
Programming

variables and If/Nested


Statements?

http://www.yahmad.co.uk/
Plenary – Refer to the Lesson Objectives

Objectives
Understand why computer programming scripts are used.
Understand the use of Variables as place holders for information.
Understand the use of if and nested if statements in Python Programming.
Programming

Plenary Task (Q&A)


Peer assess each other scripts.
Discuss the levels pupils have achieved for this task.
Question: What is the purpose of If and Nested Statements?

http://www.yahmad.co.uk/

You might also like