Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON.

Similar presentations


Presentation on theme: "Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON."— Presentation transcript:

1 Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON

2 Computing Science Software Design and Development Learning IntentionsSuccess Criteria By the end of this section, you will be able to: Assign a value to a variable directly Assign a value to a variable by input from the keyboard Identify the need for meaningful variable names I can assign a value to a variable directly within a program I can assign a value to a variable through input from the keyboard I can explain why it is important that we name variables sensibly so that they mean something to me an other programmers

3 Computing Science Software Design and Development Analysis A program is required that will demonstrate how to assign values to variables using the following methods: 1. Assign the value directly within the program 2. Assign the value from user input via the keyboard It will then display these values on the screen Copy the Analysis for this program into your jotter

4 Computing Science Software Design and Development DESIGN SET firstname= “John” SET age = 15 RECEIVE surname FROM KEYBOARD RECEIVE height FROM KEYBOARD SEND firstname & surname TO DISPLAY SEND age TO DISPLAY SEND height TO DISPLAY Copy the Design for this program into your jotter

5 Computing Science Software Design and Development IMPLEMENTATION 1. Enter the given code 2. Save the program as 4-1Ex.py 3. Run the program and correct any errors

6 Computing Science Software Design and Development Testing Copy and complete the Testing for this program into your jotter I am going to input…I expect the program to…The program actually…

7 Computing Science Software Design and Development Reporting In your jotter, complete a report: 1. By looking at the Analysis, explain how this program meets the requirements. 2. Suggest any ways in which the program could be improved.

8 Computing Science Software Design and Development Explaining the code 1. Explain, in your own words, what each of the following pieces of code does in this program: a. age = 15 b. height = input(‘What height are you, in meters?\n’) c. print firstname + ‘ ‘ + surname 2. What is the effect of missing out the \n in the input lines? 3. What information would you expect to find in the age variable?

9 Computing Science Software Design and Development Explaining the code 1.Explain, in your own words, what each of the following pieces of code does in this program: a. age = 15 Assigns the value 15 to the age variable b. height = input(‘What height are you, in meters?\n’) displays a prompt for the user to input via keyboard and assigns the entered value to the height variable c. print firstname + ‘ ‘ + surname displays the contents of firstname variable, followed by a space, followed by the contents of the surname variable

10 Computing Science Software Design and Development Explaining the code 2. What is the effect of missing out the \n in the input lines? The \n moves onto a new line. Missing it out means that formatting of output may be disrupted 3. What information would you expect to find in the firtname variable? John

11 Computing Science Software Design and Development Meaningful variable names In this program, we used 4 variables: Firstname Surname Age Height Why are these more meaningful than calling them: F S A H ?

12 Computing Science Software Design and Development Learning IntentionsSuccess Criteria By the end of this section, you will be able to: Assign a value to a variable directly Assign a value to a variable by input from the keyboard Identify the need for meaningful variable names I can assign a value to a variable directly within a program I can assign a value to a variable through input from the keyboard I can explain why it is important that we name variables sensibly so that they mean something to me an other programmers


Download ppt "Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON."

Similar presentations


Ads by Google