I have completed Part A, code is below and then section required for Part Bimport java.util.*;public class ModuleGrader { Scanner sc=new Scanner(System.in); public int getValidModuleMark(){ int mark;...

I have completed Part A, code is below and then section required for Part Bimport java.util.*;public class ModuleGrader {

Scanner sc=new Scanner(System.in);



public int getValidModuleMark(){int mark;System.out.println("Please enter a mark between 0 and 100");mark = sc.nextInt();while ( mark < 0="" ||="" mark=""> 100 ) {System.out.println("Invalid mark !");System.out.println ("Enter a mark in range 0 to 100");mark = sc.nextInt();} return mark;}

public String gradeModule(int markIn){

if(markIn > 69) {return ("Your grade is Excellent!");} else if (markIn >59) {return ("Your grade is a Good!");} else if (markIn >49) {return ("Your grade is Satisfactory");}else if (markIn > 39) {return ("Your grade is a Compensatable Fail");}else {return ("Your grade is an Outright Fail");}}

public void initialiseModuleGrader(){char response;int markIn;String grade;

System.out.println("*********** Module Grading Program *********");

do{markIn = getValidModuleMark();grade = gradeModule(markIn);System.out.println(grade);

System.out.println("Would you like to grade another mark? y/n?");response = sc.next().charAt(0);}while (response == 'y' || response == 'Y');

}
}


Part B 1. Within the York grading project, create a DegreeGrader class 2. Within the class, create a method called gradeDegree, which takes four first attempt module results (i.e. all module average, ISM module average, number of compensentable failed credits and number of outright failed modules) as parameters and returns the degree classification (e.g. “distinction”, “merit”, “pass” or “fail”). Here is an example of some of the parameters taken by the gradeDegree method: gradeDegree(44, 55, 14, 2) 3. Write one or more methods that will prompt the user for input from the keyboard for all the module averages: ISM module average, number of compensentable failed credits, and number of outright failed modules. The methods should also validate the input (e.g. module average in the range 0 to 100, number of compensentable failed credits in the range of 0-180, and number of outright failed modules in the range of 0-11). It will keep prompting the user until valid inputs have been entered. 4. Write a further method called startDegreeGrading, the method will start with displaying ("*********** Degree Classification Program *********", it will then prompt for the results to grade. For valid results, the grade will be printed on screen. The system will then ask the user a whether he/she would like to continue grading, or not, by inputting - yes/no (y/n) - This method needs to call the methods developed in “Part B 2.” and “Part B 3.” above. 5. Write a TestDegreeGrader class to test each method.
May 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here