Ministry of Education invites you to develop a system to verify the exam marks entered by...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Ministry of Education invites you to develop a system to verify the exam marks entered by the users to system for further processing. The information of students is stored in a text file called "exam.txt". The following shows the file format:(you can copy and paste them in a text file) 111111 222222 90 abc 333333 108 444444 78 555555 -90 666666 9X 777777 88 888888 888 999999 GoodLuck You propose the following classes in design: Student MarkException -int id -String mark 1..1 Exam_4 static Scanner input -static void processMark(String mark) -static boolean invalidMark(String mark) -static void displayList(ArrayList alist) +static void main(String)] args) (a) A user defined exception class called MarkException, a subclass of Exception class, that you can retrieve the exception message during processing. (b) A Student class has student id (int type, and final) and mark (String type). You prefer to choose String type as user may not enter an integer for exam mark. This is a very simple class consists of instance variables, accessor methods, mutator method, toString method (you can see the format of the string in the following display). (c) A main class that drives the application. Main method reads all info stored in the input file (i.e., exam.txt) and process them. For each line of input, you create a Student object (valid or invalid; invalid means exception occurs); if invalid, you attach some relevant exception message next to the mark. Add all objects to a list. Note that all exceptions should be handled in main. Other useful methods in this class: -The invalidMark method is make sure that all characters in the mark are digits - The processMark method checks the marks and throws three different exception messages, i.e. mark is negative, invalid characters in mark and mark is greater than 100. -The displayList method uses a Lambda expression to display the list's content: 123 123 123 Summary report Student id: 111 Student id: 2222 Student id: 333 Student id: 4444 Student id: 555555 Student id: 666666 Student id: 777777 Student id: 888888 Student id: 999999 Mark: 90 Mark: abc Mark: 108 Mark: 78 Mark: -90 Mark: 9x Mark: 88 Mark: 888 MarkException: Mark has invalid character(s) MarkException: Mark greater than 100 MarkException: Negative mark MarkException: Mark has invalid character(s) MarkException: Mark greater than 100 Mark: Goodluck MarkException: Mark has invalid character(s) Ministry of Education invites you to develop a system to verify the exam marks entered by the users to system for further processing. The information of students is stored in a text file called "exam.txt". The following shows the file format:(you can copy and paste them in a text file) 111111 222222 90 abc 333333 108 444444 78 555555 -90 666666 9X 777777 88 888888 888 999999 GoodLuck You propose the following classes in design: Student MarkException -int id -String mark 1..1 Exam_4 static Scanner input -static void processMark(String mark) -static boolean invalidMark(String mark) -static void displayList(ArrayList alist) +static void main(String)] args) (a) A user defined exception class called MarkException, a subclass of Exception class, that you can retrieve the exception message during processing. (b) A Student class has student id (int type, and final) and mark (String type). You prefer to choose String type as user may not enter an integer for exam mark. This is a very simple class consists of instance variables, accessor methods, mutator method, toString method (you can see the format of the string in the following display). (c) A main class that drives the application. Main method reads all info stored in the input file (i.e., exam.txt) and process them. For each line of input, you create a Student object (valid or invalid; invalid means exception occurs); if invalid, you attach some relevant exception message next to the mark. Add all objects to a list. Note that all exceptions should be handled in main. Other useful methods in this class: -The invalidMark method is make sure that all characters in the mark are digits - The processMark method checks the marks and throws three different exception messages, i.e. mark is negative, invalid characters in mark and mark is greater than 100. -The displayList method uses a Lambda expression to display the list's content: 123 123 123 Summary report Student id: 111 Student id: 2222 Student id: 333 Student id: 4444 Student id: 555555 Student id: 666666 Student id: 777777 Student id: 888888 Student id: 999999 Mark: 90 Mark: abc Mark: 108 Mark: 78 Mark: -90 Mark: 9x Mark: 88 Mark: 888 MarkException: Mark has invalid character(s) MarkException: Mark greater than 100 MarkException: Negative mark MarkException: Mark has invalid character(s) MarkException: Mark greater than 100 Mark: Goodluck MarkException: Mark has invalid character(s)
Expert Answer:
Posted Date:
Students also viewed these databases questions
-
Graded Project: Research Paper Introduction You have reviewed the following skills: How to conduct research on a topic How to write a well-developed research essay How to develop an analysis of the...
-
Have a C compiler which is ANSI conforming in all respects except that it has no facility for the definition, declaration or use of standard C structures. Outline a set of routines written in this...
-
An employee received the following benefits: regular compensation income, net of P25,000 SSS, PHIC & HDMF employee share - P850,000; 13th month pay - P120,000; De minimis benefits within their limits...
-
Examine what happens to the debt ratio when: a. Short-term debt is converted into an equivalent amount of long-term debt. b. A major asset is sold, with part of the proceeds being used to repay debt....
-
A metal bowl with a weight of 1.10 N is placed in a larger kitchen container filled with coconut oil. How much coconut oil must the bowl displace in order to float? For reference, the mass density of...
-
The fixed budget performance report for the year ended 30 June 2025 for Motueka Mint is as follows. Required (a) Convert the fixed budget performance report prepared by Motueka Mint to a flexible...
-
1. In light of the foregoing payoffs, why did Airbus go ahead with the A380 Superjumbo even though its $10.7 billion development cost required as many as 250 planes to break even by 2010? 2. In 2004,...
-
Did the government have an easy time convicting Elizabeth Holmes?
-
Zoltan Company analyzes its accounts receivable at December 31, 2017, and arrives at the following totals for its two customer groups along with the percentages for each customer group that are...
-
How to develop a branding strategy evaluation model that can be applied to consumer brands?
-
VRIO and Porter's five forces analysis of Airbnb Business Travel Vertical in Asia case study. Please expand for explanation.
-
Provide a Strength / Weaknesses analysis for Tim Hortons compared to its competitors Starbucks and McDonalds.
-
Which are the most relevant IMC tools in the maturity stage (the fourth) of the Product Life Cycle? And explain them.
-
You are a financial accountant working at Knappa Foods Limited ( Knappa ) . Knappa is a manufacturer and retailer of food products. It has two manufacturing facilities in Australia one in Gosford,...
-
UPS recently purchased a company called Coyote Logistics for 1.8 Billion. Research the acquisition and explain why one Logistics Company would buy another in other words, what did UPS get out of the...
-
Southwestern Punch was made by Frutayuda, Inc. and sold in 12-ounce cans to benefit victims of Hurricane Zero. The mean number of ounces placed in a can by an automatic fill pump is 11.7 with a...
-
Illustrate by using a class diagram of temptation patterns of each of the new applications you listed for question fourteen.
-
What is the trade-off of using this stable pattern versus the traditional approach?
-
Present the sequence diagram for applicability of the temptation stable analysis pattern in the e-commerce domain, specifically marketing.
Study smarter with the SolutionInn App