Textbook Notes (280,000)
US (110,000)
Purdue (700)
CS (30)
Chapter 1, 2

# CS 17700 Chapter Notes - Chapter 1, 2: Software Development Process, Eval

Department
Computer Sciences
Course Code
CS 17700
Professor
Gary Mc Fall
Chapter
1, 2

This preview shows half of the first page. to view the full 3 pages of the document.
Python Programming
Lecture 3: 6/15/17
-Software Development Process
Objective: understand and write Python statements to output information to the screen, assign values
to variables, get numeric information entered from the keyboard, and perform a counted loop
Software Development is broken down into stages according to the information that is produced in
each phase
Example in Red
1. Analyze the Problem
“The temperature is given in Celsius and the user wants in in Fahrenheit”
2. Determine Speciﬁcation: Describe what the program will do (not how)
“Input- temperature in Celsius, Output temperature in FaHrenheit, Output =9/5(input)+32”
3. Create a Design (algorithm) PSEUDOCODE
Outline : Input, Process, Output (IPO)
Gameplan : Prompt the user for input (Celsius temperature)
Process it to convert it to Fahrenheit using F = 9/5(C) + 32
Output the result by displaying it on the screen
Python Version :
#convert.py
# A program to convert Celsius temps to Fahrenheit
# by: Susan Computewell
def main():
celsius = eval(input("What is the Celsius temperature? "))
fahrenheit = (9/5) * celsius + 32
print("The temperature is ",fahrenheit," degrees Fahrenheit.")
main()
4. Implement the design (look at pseudo code)
5. Test/Debug Program: ﬁnd all the errors, test trail
>>>What is the Celsius temperature? 0
The temperature is 32.0 degrees Fahrenheit.
>>> main()
What is the Celsius temperature? 100
The temperature is 212.0 degrees Fahrenheit.
>>> main()
What is the Celsius temperature? -40
The temperature is -40.0 degrees Fahrenheit.
>>>
6. Maintain Program: continue developing the program in response of the users (Update it)
###### You're Reading a Preview

Unlock to view full version