Also Include Javadoc comments in the code, this code is for CTP - 150, java CTP 150
Fantastic news! We've Found the answer you've been seeking!
Question:
Also Include Javadoc comments in the code, this code is for CTP - 150, java
Transcribed Image Text:
CTP 150 Computer Science 1 Lab Assignment (100 points): In this lab, you will demonstrate your understanding of advanced file IO and recursion. 1. Download Lab12_StudentFiles.zip which contains Sudent.java, CompSciStudent.java and CompSciStudent Demo.java files, and then based on these files, do exception handling, object serialization and deserialization. • • • Write exception classes for the following error conditions: О An invalid year is given for the student's year admitted. This would be a year which is greater than the current year (you can use 2023). О An invalid value is given credit hours in any of three categories (math, computer science and general education). This would be a negative number. Throw exceptions in the superclass and subclass where exception may occur. Add @exception javadoc to methods which throw exception(s). In the application class (you can modify CompSciStudent Demo.java file): Create at least THREE objects of CompSciStudent class in an array or ArrayList object. о О Instantiate objects by asking for user inputs using a loop, or passing arbitrary arguments to a constructor/mutators directly. О о Handle exceptions. Recovery is optional for this assignment. If you do not do recovery, use System.exit(0) in the catch block to terminate the program if an exception is thrown. Serialize and deserialize objects (Need to handle IOException) ■ Notes: Serialization Save/write objects to a binary file. - Deserialization - Read data on the objects from the file. And then display information on all students on the screen. You can study Module 11 PPT notes (Slides #53 - 76) and Examples in the Serialization folder (In Module 11 Code Examples). " You must handle IOException. ■ Write code for both of Serialization and deserialization in ONE application class. Running examples: If a year is invalid: Error: Year 2024 is invalid. • If any credit hour input is invalid: Error: Credit hours cannot be less than 0. 2 CTP 150 Computer Science 1 Lab Assignment (100 points): In this lab, you will demonstrate your understanding of advanced file IO and recursion. 1. Download Lab12_StudentFiles.zip which contains Sudent.java, CompSciStudent.java and CompSciStudent Demo.java files, and then based on these files, do exception handling, object serialization and deserialization. • • • Write exception classes for the following error conditions: О An invalid year is given for the student's year admitted. This would be a year which is greater than the current year (you can use 2023). О An invalid value is given credit hours in any of three categories (math, computer science and general education). This would be a negative number. Throw exceptions in the superclass and subclass where exception may occur. Add @exception javadoc to methods which throw exception(s). In the application class (you can modify CompSciStudent Demo.java file): Create at least THREE objects of CompSciStudent class in an array or ArrayList object. о О Instantiate objects by asking for user inputs using a loop, or passing arbitrary arguments to a constructor/mutators directly. О о Handle exceptions. Recovery is optional for this assignment. If you do not do recovery, use System.exit(0) in the catch block to terminate the program if an exception is thrown. Serialize and deserialize objects (Need to handle IOException) ■ Notes: Serialization Save/write objects to a binary file. - Deserialization - Read data on the objects from the file. And then display information on all students on the screen. You can study Module 11 PPT notes (Slides #53 - 76) and Examples in the Serialization folder (In Module 11 Code Examples). " You must handle IOException. ■ Write code for both of Serialization and deserialization in ONE application class. Running examples: If a year is invalid: Error: Year 2024 is invalid. • If any credit hour input is invalid: Error: Credit hours cannot be less than 0. 2
Expert Answer:
Answer rating: 100% (QA)
Here is a possible implementation for the given requirements import javaio import javautil class InvalidYearException extends Exception public InvalidYearExceptionString message supermessage class Inv... View the full answer
Related Book For
Data Modeling and Database Design
ISBN: 978-1285085258
2nd edition
Authors: Narayan S. Umanath, Richard W. Scammel
Posted Date:
Students also viewed these programming questions
-
. Suppose that the city of New York issues bonds to raise money to pay for a new tunnel linking New Jersey and Manhattan. An investor named Susan buys one of the bonds on the same day that the city...
-
What is the energy of photons (joules) emitted by a 91.7-MHz FM radio station?
-
The following information is available for a company: Required: Applying both a perpetual and a periodic inventory system, prepare the journal entries that summarize the transactions that created...
-
The company is committed to ethical conduct and has no tolerance for fraud and unethical behavior. There are some concerns about abuses in your department. Do you know anything about the concerns I...
-
Analyze Take- Twos 1998-2000 financial data included in Exhibit 1. Compute the following financial ratios for each of those years: age of accounts receivable, age of inventory, gross profit...
-
Discuss each of the following terms: (a) data (b) database (c) database management system (d) database application program (e) data independence (f) security (g) integrity (h) views 2. What is...
-
Determine the voltages at the nodes. 4 2 2 0 2 8 3 3 A 4 2ix
-
Tre is a recent college graduate who works in the finance and analytics department of a large publicly traded software company. Recently, Tre discovered an alarming discrepancy in the recording of...
-
At December 3 1 2 0 1 8 , Hansen Corporation had 5 0 , 0 0 0 shares of common stock and 5 , 0 0 cumulative preferred stock outstanding. No dividends were declared or paid in 2 0 1 8 . Net $ 2 0 0 , 0...
-
Cecilia recently purchased a $ 2 million policy on her life. A few weeks later, after her attorney completed drafting an irrevocable trust to hold the policy and receive the proceeds upon her death,...
-
You invested $50,000 in a mutual fund last year. At the time you opened your account, the mutual fund shares had a NAV of $50. The fund charges a 2% front-end load and a 1% back-end load. During the...
-
How does social constructionism elucidate the process by which shared understandings and meanings are collectively created and perpetuated within societies?
-
What is marginal utility? Explain.
-
As you rewrite these sentences, replace the cliches and buzzwords with plain language (if you don't recognize any of these terms, you can find definitions online): a. Being a jack-of-all-trades, Dave...
-
Examine the CASE tools, ERWin, and Oracle/Designer, and discuss the ER modeling grammar supported by each of them.
-
Consider the EMPLOYEE entity type given below. a. List all key and non-key attributes. b. What is (are) the unique identifier(s)? c. Which attribute(s) is (are) derived attributes? d. Using the...
-
Given the set of functional dependencies F {fd1, fd2, fd3, fd4, fd5, fd6, fd7, fd8, fd9, fd10} where: a. Construct the universal relation schema that includes (i.e., preserves) the set of functional...
-
For coordinates \(\left(x^{1}, x^{2} ight)\) and metric \(g=\operatorname{diag}\left(g_{11}, g_{22} ight)\), the Gaussian curvature is For a sphere with coordinates defined in the following figure,...
-
Consider the holonomic basis defined in Box 26.1 . Using that the tangent vector for a curve can be written \(t=t^{\mu} e_{\mu}=\left(d x^{\mu} / d \lambda ight) e_{\mu}\), show that Thus, \(g_{\mu...
-
The Lie bracket of vector fields \(A\) and \(B\) is defined as their commutator, \([A, B]=\) \(A B-B A\). The Lie bracket of two basis vectors vanishes for a coordinate basis but not for a...
Study smarter with the SolutionInn App