Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 3 Use DEV-C++ to develop a well-documented C++ program that: 1) Prompts the user to enter from the keyboard an integer value named
Assignment 3 Use DEV-C++ to develop a well-documented C++ program that: 1) Prompts the user to enter from the keyboard an integer value named credits between 0 and 120 representing the number of credit hours passed by a UOB student. 2) Validates the entered value: a) If the entered value is NOT in the range (0..120), then prints an error message: "Error: Unacceptable number of credits. Bye ", and quits the program. b) Otherwise, classifies and prints the student's category based on credits passed by a student as shown in the following table. Credit hours From 00 to less than 31 From 31 to less than 61 From 61 to less than 91 From 91 to 120 Less than 0 or greater than 120 Student category freshman sophomore junior senior Error c) Displays on the screen the entered value and the student's category as shown below. 3) Repeat the previous steps for unknown number of students until 999 is entered by the user. Sample runs: Enter an integer between 0 and 120 please: 25 You passed 25 credits: You are a freshman student. Enter an integer between 0 and 120 please: 137 Error: Unacceptable number of credits. Bye. Enter an integer between 0 and 120 please: 40 You passed 40 credits: You are a sophomore student. Enter an integer between 0 and 120 please: 999 Congratulations. Program finished.
Step by Step Solution
★★★★★
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
ALGORITHM STEP 1 In main class declare the credithours as integer value STEP 2 Ask the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started