CPSC170A
Fundamentals of Computer Science II

Lab 3

Conditionals

Min

Details

Write a function called min that prints the minimum of 3 numbers.

Example

The function calls:

min(1.5, 0.75, 2.2);
min(-3.0, 1.2, 0.25);
min(0.3, 0.2, 0.1);

Would produce the outputs:

0.75
-3.0
0.1


Grade Conversion

Write a function called convert_grade that converts a numeric grade to a letter grade. The function should print the letter grade.

Example

The function calls:

convert_grade(100);
convert_grade(90);
convert_grade(89);
convert_grade(80);
convert_grade(79);
convert_grade(70);
convert_grade(69);
convert_grade(60);
convert_grade(59);
convert_grade(0);

Would produce the outputs:

A
A
B
B
C
C
D
D
F
F