/* Program 4.3.1 from M.Sc. C++ Programming Lecture notes  */

/* Author: Rob Miller and William Knottenbelt
   Program last changed: 30th September 2023 */

/* This program prompts for a test score out of 100, 
   and then prints an appropriate message */ 

#include <iostream>
using namespace std;

int main() 
{
	int total_test_score, score_out_of_ten;
	
	cout << "Enter test score (as a percentage between 0 and 100): ";
	cin >> total_test_score;
		
	score_out_of_ten = total_test_score / 10;
	
	switch (score_out_of_ten)
	{
		case 0:
		case 1:
		case 2:
		case 3:
		case 4:		cout << "You are a failure - you ";
					cout << "must study much harder.\n";
					break;
					
		case 5:		cout << "You have just scraped through the test.\n";
					break;
		
		case 6:
		case 7:		cout << "You have done quite well.\n";
					break;
					
		case 8:
		case 9:
		case 10:	cout << "Your score is excellent - well done.\n";
					break;
					
		default:	cout << "Incorrect score - must be between ";
					cout << "0 and 100.\n";
	}
	
	return 0;
}
