1. Write a program that inputs two numbers. Test if the first number is greater than (or less than) the second. What happens if you enter numbers that are equal? How do you account for the result? 2....

1 answer below »
1. Write a program that inputs two numbers. Test if the first number is greater than (or less than) the second. What happens if you enter numbers that are equal? How do you account for the result?
2. Write a program that allows you to enter a numeric grade (i.e. 85, 68, 94). Output the corresponding letter grade. Be sure to test for all outcomes (i.e., 90, 80, 0, -1, 129). Display an error message where appropriate.
3. Write a program that takes as input the values 27.2, 35.6, 41.2. Compute the average of the three values.
4. Write a program that takes as input the month (1-12), day (1-31), and year (yyyy). Determine if the date entered is a valid birthday for someone who is alive today.
a.Check if the date is in the future (HINT: convert date to yyyymmdd format, i.e. 20140214 to test),
b. Check if more than 100 years old,
c.Check if days of the month are appropriate (i.e., February 31st is obviously wrong).
Answered Same DayMay 30, 2021

Answer To: 1. Write a program that inputs two numbers. Test if the first number is greater than (or less than)...

Nithin answered on May 30 2021
126 Votes
CPPAssingment/q2.cpp
#include
using namespace std;
int main() {
int grade;
    cout
<<"Enter numeric grade"<    cin>>grade;
    
    // Grade A if numeric grade is in 91-100 range
    if(grade>=91 && grade<=100)
     cout<<"Grade A";
    // Grade B if numeric grade is in 81-90 range
    else if(grade>=81 && grade<=90)
     cout<<"Grade B";
    // Grade C if numeric grade is in 71-80 range
    else if(grade>=71 && grade<=80)
     cout<<"Grade C";
    // Grade D if numeric grade is in 61-100 range
    else if(grade>=61 && grade<=70)
     cout<<"Grade D";
    // Grade A if numeric grade is in 51-60 range
    else if(grade>=51 && grade<=60)
     cout<<"Grade E";
    // Grade F if numeric grade is in 0-50 range
    else if(grade>=0 && grade<=50)
     cout<<"Grade F";
    // If grade falls in neither of these criteria then it's an error
    // Example : -1, 101 etc
    else
     cout<<"Inappropriate grade value";
    
    return...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here