PYTHON Assignment 2 (Programming Structures and Functions)

adventurescoldSoftware and s/w Development

Nov 7, 2013 (3 years and 5 months ago)

103 views

Spring 2010


P
YT
HON Assignment
2

(
Programming Structures and Functions
)

CIS150AB


Marrer

Spring 2010


1.

Create a logic design (with either a Flowchart or pseudo code) and a PYTHON program (module)
called IFProcessing.py that documents and executes the following

a.

Colle
ct a grade (1 to 100) as input from the user

b.

Using nested IF statements print a
letter
grad
e

to the screen
using the following rules:

i.

100
-
90 = A

ii.

89
-
80 = B

iii.

79


70 = C

iv.

69


60 = D

v.

< 60 = F

c.

Make sure all PYTHON statements have a program comment explaining wh
at the
statement is doing

in the pr
ogram.


2.

Using th
e

logic

in exercise #1
, create a new PYTHON program called FORProcessing.py that asks
for the number of students
to grade
and then loops through the algorithm for as many times as
there is students
.
Each processed grad
e should
also
print to the screen. Make sure all PYTHON
statements have a program comment explaining what the statement is doing

in the program
.


3.

T
aking your program from #2
,

create a new program called FunctionProcessing.py. In this
pro
gram
,

you will want to modularize
your PYTHON code so that the IF logic used to determine
the grade is in its own function with the score passed to the function and the letter grade
returned.

Make sure all PYTHON statements have a program comment explaining what the
statement is doing

in the program
.


Su
bmit your completed assignments to your Ready to Grade folder on the eGCC server.