JJ logo

Lab 15

. Combination operators and De Morgan's Law

Write the letter-grade program without using any
elseif-commands or else-commands
and learn about De Morgan's Law using an example

----------------------------------------
Lab #15.1: Letter grading using and- and or- operators
----------------------------------------

Assign a letter grade to a test score using many
if-commands and combination operators.

----------------------------------------
Lab #15.2: Negating a condition
----------------------------------------

Consider any condition that requires three comparisons.
Write a program that tests the condition.
Next, write a program that tests the opposite of the condition.

For example, write a program that will assign a grade
of PASS or NOT-PASS based on three comparisons:
1. Letter grade is A, B, C or D
2. Attendance is fifty percent or more
3. class participation is true

First write the program for the above condition
using one if-command that will print the grade of PASS
if all three of the above comparisons are true.
Next, write a second program that will write the
grade of NOT-PASS if the above condition is not true.
Do not use an elseif- or else-command.

Thoroughly test your program to verify that it completely works.