program in which we calculate total marks in a course and print a course grade by using if-else conditions. However check, if user enters correct marks or not, for example midterm marks is between 0 to 20. If user enters midterm marks less than 0 or greater than 20 then print incorrect marks, please re-enter midterm marks. The same check will be tested with quiz, assignment, lab work and final marks. Then print total marks in a course that is greater than or equal to 0 and less than or equal to 100. Marks distribution as:
Midterm 0-20
Quiz 0-5
Assignment 0-5
Lab Work 0-20
Final 0-50
90 or greater = Grade A
80-89.99 = Grade B
70-79.99 = Grade C
60-69.99 = Grade D
59.99 or lower = Grade F
Here is more detail output screen:
Display: Enter midterm marks:
Input: 15
Display: Enter quiz marks:
Input: 10
Display: You have entered incorrect marks of quiz, please re-enter quiz marks:
Input: 5
Display: Enter assignment marks:
Input: 6
Display: You have entered incorrect marks of assignment, please re-enter assignment marks:
Input: 10
Display: You have entered incorrect marks of assignment, please re-enter assignment marks:
Input: 50
Display: You have entered incorrect marks of assignment, please re-enter assignment marks:
Input: 3
Display: Enter lab marks:
.
.
.
Hint: Quite many if else conditions will be used. Use while or do-while loops to take re-input.
Suzie999 245 Coding Hobbyist
Salman93 -2 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Salman93 -2 Newbie Poster
Suzie999 245 Coding Hobbyist
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Salman93 -2 Newbie Poster
Salman93 -2 Newbie Poster
np complete 8 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Salman93 -2 Newbie Poster
Suzie999 245 Coding Hobbyist
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
np complete 8 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.