Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

final lab - Word REFERENCES MAILINGS REVIEW VIEW Task Description You are going to create a grader system application This application will read the Name,

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

final lab - Word REFERENCES MAILINGS REVIEW VIEW Task Description You are going to create a grader system application This application will read the Name, Registration Number and Answers of various True/False questions stored in a result ist file. A answer Key txt file is also provided that have the correct answers to all the questions, Your program will read the data from the result ixt file and store them in Student objects. A grader application will check the answers stored in Student objects with the answer provided in answer Key txt file and calculate the result of each student and store its marks and grade into student object The grades are assigned on the same formula as your grades in COMSATS university means A grade for 90% marks, A- for 85% marks and so on. You will create your own custom exception called FailException, that will be thrown in case a student secured less then 50% marks The data stored in students object will finally be write on a output txt file. The total project will consist of following classes and interfaces that you will have to complete in order to get a working grader application. Qasm IBEESA Falexception.java B FileOperations.java Grader sava Result Calculation.java Student.java Test.java Your submission should be exactly matching with this project structure. Task 2: Create an Interface EleOnesting in your project that has following five methods (maks) a neozvoia b peadResultate void c. madkabile vond d waiteResultede(void e. closeFile0 void Task 3: Create an Interface Result Calculation in your project that has following method (Mark) a madeCalculatio 0 void Task 4: Create a class Student that holds the following information (5 marks) a name:String breg No:String c. ansl String d. ans2 String ans 3:String f. ans4 String gans5-String hans6:String ans 7:String j. ans 8:String kans9-String 1 2010:String m. answers-String[] m. gade String Tack 5: Encapsulzte the Student class, and Provide the implementation of toString() method in Student class. Marks) DE ENGLISH (UNITED STATES) to search - Word Task 6: Create a enstom exception called Excalian Mark) Task 7: Create a Grader dans that will implements the Operation and Resulalculation interface. (2 Marks) Task 8: Create the text file named key.txt and result.txt in your project directory that has the following data (2 mark) key.at - Notepad File EdR Format View Help he T T T result.xt-Notepad File Edit Format View Help kasin 001 TETETETETE Ali 002 FT FT FT FT FT FI F T Task 9: Now write the appropriate code inside Operfde method in Grader class that will use Scanner class to Open the key.txt and result.txt file (2 marks) Boverride public void openFile (... Task 10: Now write the appropriate code using Scanner class API inside the readResultFile method in Grader class, this code will read the data stored in resultext file that was opened in OpenFileo function. This data will be passed to create the two objects of Student class. For example Qasim will be stored as name of Student object, 001 will be stored as tegno of Student object, I will be stored as ansl in Student Object, E will be stored in ans2 in Student Object, and so on. After the first line again the same process will repeat and another Student object will be created to store the information written in line 2 of result.txt file. (10 Marks) @Override public void readResultFile.. la () ENG 12:1 11/0 final la HOME INSERT DESIGN PAGE LAYOUT REFERENCES MAILINGS REVIEW VIEW Taxk 11Now write the appropriate code using Semner class API inside the readKrFilemethod in Grader class, this code will read the data stored in key txt file that was opened in OpenFile( fimction This data will be stored in an answer key Anay. The first digit 10 in the key.txt file will be used to determine the size of answer key array. (Mark) goverride public void reaaeyrileo (...) ) Task 12: Now wnite the appropriate code inside the method for gradeCalculation. This code will calculate the marks based on answer key data and the data stored in Student objects. Each correct angwer will be awarded 10 marks and each wrong answer will be awarded 0 marks. Based on total marks Assign the appropriate grade letter. (10 marks) @Override public void gradeCalculation ( Task 13: Throw the FailException object if a student will get less than 50 marks. (5 marks) Task 14: Now write the appropriate code using Formatter API inside the writeResultFile( method, this code will write the Name, ReeNo, Marks and Grade details into a output.txt file. The output will be in the following fomat as shown in figure. (10 marks) output Notepad File Edit Format ViewHelp basim 001 4F A 002 6 C Covede NO Writere 110 KM Task 15: Write appropriate display Kexo and display:Result methods in Grader class to show the data stored after reading from file. (5 Marks) publicansplaykey pe void displaystudent Task 16: Encapsulate the Grader class. (5 marks) Task 17: write appropriate code inside the closeFileli method that will close the key txt, result.txt and output txt files (if already opened) (5 marks) 5 OF 6 1052 WORDS LE ENGLISH (UNITED STATES) Type here to search Override public void constile() (...) Tack 17: Create a Test class that will have mzim methodInside the man method create a object of Grader class and all the fonctions in the order as shown in Figure below. (5 marks) Grader result new Grader(); result.openFile(); teruit.readResultFile(); result.readKeyFile(); result.gzadeCalculation(); result.displayStudent (); result.writeResolteile(); result.closeFile(); Tack18: Progam shonld be executed successfully (20 Marks) Tazk19. The result of the execution should be as shown in figure below (1 mark) Qasimo IBEESA. FallException: You are not qualited mm Region01 An - T 27 we 3 wer OST e E sve OT MES WELOT WUWUWW your grades are 11 TTTTTTTTTTTTTTTTT I A Region A e 6 WELT your grades are 117 Your marks are Ca 4 ENG 12 11/ final lab - Word REFERENCES MAILINGS REVIEW VIEW Task Description You are going to create a grader system application This application will read the Name, Registration Number and Answers of various True/False questions stored in a result ist file. A answer Key txt file is also provided that have the correct answers to all the questions, Your program will read the data from the result ixt file and store them in Student objects. A grader application will check the answers stored in Student objects with the answer provided in answer Key txt file and calculate the result of each student and store its marks and grade into student object The grades are assigned on the same formula as your grades in COMSATS university means A grade for 90% marks, A- for 85% marks and so on. You will create your own custom exception called FailException, that will be thrown in case a student secured less then 50% marks The data stored in students object will finally be write on a output txt file. The total project will consist of following classes and interfaces that you will have to complete in order to get a working grader application. Qasm IBEESA Falexception.java B FileOperations.java Grader sava Result Calculation.java Student.java Test.java Your submission should be exactly matching with this project structure. Task 2: Create an Interface EleOnesting in your project that has following five methods (maks) a neozvoia b peadResultate void c. madkabile vond d waiteResultede(void e. closeFile0 void Task 3: Create an Interface Result Calculation in your project that has following method (Mark) a madeCalculatio 0 void Task 4: Create a class Student that holds the following information (5 marks) a name:String breg No:String c. ansl String d. ans2 String ans 3:String f. ans4 String gans5-String hans6:String ans 7:String j. ans 8:String kans9-String 1 2010:String m. answers-String[] m. gade String Tack 5: Encapsulzte the Student class, and Provide the implementation of toString() method in Student class. Marks) DE ENGLISH (UNITED STATES) to search - Word Task 6: Create a enstom exception called Excalian Mark) Task 7: Create a Grader dans that will implements the Operation and Resulalculation interface. (2 Marks) Task 8: Create the text file named key.txt and result.txt in your project directory that has the following data (2 mark) key.at - Notepad File EdR Format View Help he T T T result.xt-Notepad File Edit Format View Help kasin 001 TETETETETE Ali 002 FT FT FT FT FT FI F T Task 9: Now write the appropriate code inside Operfde method in Grader class that will use Scanner class to Open the key.txt and result.txt file (2 marks) Boverride public void openFile (... Task 10: Now write the appropriate code using Scanner class API inside the readResultFile method in Grader class, this code will read the data stored in resultext file that was opened in OpenFileo function. This data will be passed to create the two objects of Student class. For example Qasim will be stored as name of Student object, 001 will be stored as tegno of Student object, I will be stored as ansl in Student Object, E will be stored in ans2 in Student Object, and so on. After the first line again the same process will repeat and another Student object will be created to store the information written in line 2 of result.txt file. (10 Marks) @Override public void readResultFile.. la () ENG 12:1 11/0 final la HOME INSERT DESIGN PAGE LAYOUT REFERENCES MAILINGS REVIEW VIEW Taxk 11Now write the appropriate code using Semner class API inside the readKrFilemethod in Grader class, this code will read the data stored in key txt file that was opened in OpenFile( fimction This data will be stored in an answer key Anay. The first digit 10 in the key.txt file will be used to determine the size of answer key array. (Mark) goverride public void reaaeyrileo (...) ) Task 12: Now wnite the appropriate code inside the method for gradeCalculation. This code will calculate the marks based on answer key data and the data stored in Student objects. Each correct angwer will be awarded 10 marks and each wrong answer will be awarded 0 marks. Based on total marks Assign the appropriate grade letter. (10 marks) @Override public void gradeCalculation ( Task 13: Throw the FailException object if a student will get less than 50 marks. (5 marks) Task 14: Now write the appropriate code using Formatter API inside the writeResultFile( method, this code will write the Name, ReeNo, Marks and Grade details into a output.txt file. The output will be in the following fomat as shown in figure. (10 marks) output Notepad File Edit Format ViewHelp basim 001 4F A 002 6 C Covede NO Writere 110 KM Task 15: Write appropriate display Kexo and display:Result methods in Grader class to show the data stored after reading from file. (5 Marks) publicansplaykey pe void displaystudent Task 16: Encapsulate the Grader class. (5 marks) Task 17: write appropriate code inside the closeFileli method that will close the key txt, result.txt and output txt files (if already opened) (5 marks) 5 OF 6 1052 WORDS LE ENGLISH (UNITED STATES) Type here to search Override public void constile() (...) Tack 17: Create a Test class that will have mzim methodInside the man method create a object of Grader class and all the fonctions in the order as shown in Figure below. (5 marks) Grader result new Grader(); result.openFile(); teruit.readResultFile(); result.readKeyFile(); result.gzadeCalculation(); result.displayStudent (); result.writeResolteile(); result.closeFile(); Tack18: Progam shonld be executed successfully (20 Marks) Tazk19. The result of the execution should be as shown in figure below (1 mark) Qasimo IBEESA. FallException: You are not qualited mm Region01 An - T 27 we 3 wer OST e E sve OT MES WELOT WUWUWW your grades are 11 TTTTTTTTTTTTTTTTT I A Region A e 6 WELT your grades are 117 Your marks are Ca 4 ENG 12 11/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+3. What resources will these tactics require?

Answered: 1 week ago