Question: Question 1 ( Simple Grading System ) : ( 1 mark ) Write a C + + program that does the following: Prompts the user

Question 1(Simple Grading System): (1 mark)
Write a C++ program that does the following:
Prompts the user to enter their score for a recent exam (a value between 0 and 100).
Using an if-else statement, the program should determine the grade based on the following criteria:
o Score 90 and above: Grade A
o Score 80-89: Grade B
o Score 70-79: Grade C
o Score 60-69: Grade D
o Score below 60: Grade F
After determining the grade, the program should output a message with the user's score and corresponding grade.
Example:
Input:
Enter your exam score: 85
Output:
Your score is 85, and your grade is B.
Question 2(Simple Calculator): (2 marks)
Write a C++ program that does the following:
Prompts the user to enter two numbers.
Asks the user to choose an operation (+,-,*,/).
Using a switch statement, the program should perform the chosen operation on the two numbers and display the result.
If the user enters an invalid operation, the program should display an error message.
Example:
Input:
Enter first number: 10
Enter second number: 5
Choose an operation (+,-,*,/): *
Output:
Result: 10*5=50
Invalid Operation Example:
Input:
Enter first number: 10
Enter second number: 5
Choose an operation (+,-,*,/): %
Output:
Error: Invalid operation.
Question 3(Find Duplicate Value): (2 marks)
Write a C++ program that does the following:
Prompts the user to enter four integer values.
The program should check if any two or more of the values are duplicates.
If a duplicate is found, the program should print a message saying which value is duplicated.
If no duplicates are found, the program should print a message indicating that all values are unique.
Example 1:
Input:
Enter four integers: 3735
Output:
Duplicate value found: 3
Example 2:
Input:
Enter four integers: 1234
Output:
All values are unique.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!