I l@ve RuBoard |
![]() ![]() |
6.9 Programming ExercisesExercise 6-1: A professor generates letter grades using Table 6-3.
Write a program that accepts a numeric grade and displays the corresponding letter grade. Exercise 6-2: Modify the previous program to print out a + or - after the letter grade based on the last digit of the score. The modifiers are listed in Table 6-4.
For example, 81=B-, 94=A, and 68=D+. Note that an F is only an F; there is no F+ or F-.
Exercise 6-3: Given an amount less than $1.00, compute the number of quarters, dimes, nickels, and pennies needed. Exercise 6-4: A leap year is any year divisible by 4 unless it is divisible by 100, but not 400. Write a program to tell whether a year is a leap year. Exercise 6-5: Write a program that, given the number of hours an employee worked and her hourly wage, computes her weekly pay. Count any hours over 40 as overtime at time-and-a-half. |
I l@ve RuBoard |
![]() ![]() |