Docsity

Basic Concepts of Computing - Outlines | ECS 010, Exams of Computer Science

Toggle sidebar
bg1
ECS 10, Basic Concepts of Computing Spring Quarter 2009
Version of April 2, 2009 at 7:10 AM Page 1 of 1
Outline for April 3, 2009
Reading: text, §2.1–2.3
1. Software development
a. Analyze the problem
b. Determine specifications
c. Create a design
d. Implement the design
e. Test/debug the program
f. Maintain the program
2. Example: program to convert temperature
a. Do we go from Fahrenheit to Celsius, Celsius to Fahrenheit, or both?
b. Go from Celsius to Fahrenheit
c. Steps in the program:
i. Ask user for temperature in Celsius
ii. Convert to Fahrenheit (using well-known formula)
iii. Print result in Fahrenheit
d. Implementation: see tempcvt.py
3. Example: sum of first n numbers
a. Do we include n or not?
b. Begin at 1, add numbers up to and including n
c. Steps in the program:
i. Initialize total to 0
ii. Ask user for number
iii. Count from 1 up to number
1. Add each number to total
iv. Print result
d. Implementation: see sum.py
e. It doesn’t work—show how to debug it (see sum2.py for working version)
4. Variables
a. What they are
b. Names, identifiers
c. Legal, illegal names
d. Reserved words
5. Expressions
a. Operation, operand
b. Operators +, –, *, /, %, **
c. Name Errors

Partial preview of the text

Download Basic Concepts of Computing - Outlines | ECS 010 and more Exams Computer Science in PDF only on Docsity!

ECS 10, Basic Concepts of Computing Spring Quarter 2009 Version of April 2, 2009 at 7 : 10 AM Page 1 of 1

Outline for April 3, 2009

Reading : text, §2.1–2.

  1. Software development a. Analyze the problem b. Determine specifications c. Create a design d. Implement the design e. Test/debug the program f. Maintain the program
  2. Example: program to convert temperature a. Do we go from Fahrenheit to Celsius, Celsius to Fahrenheit, or both? b. Go from Celsius to Fahrenheit c. Steps in the program: i. Ask user for temperature in Celsius ii. Convert to Fahrenheit (using well-known formula) iii. Print result in Fahrenheit d. Implementation: see tempcvt.py
  3. Example: sum of first n numbers a. Do we include n or not? b. Begin at 1, add numbers up to and including n c. Steps in the program: i. Initialize total to 0 ii. Ask user for number iii. Count from 1 up to number
  4. Add each number to total iv. Print result d. Implementation: see sum.py e. It doesn’t work—show how to debug it (see sum2.py for working version)
  5. Variables a. What they are b. Names, identifiers c. Legal, illegal names d. Reserved words
  6. Expressions a. Operation, operand b. Operators +, – , *, /, %, ** c. Name Errors