Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Also Include Javadoc comments in the code, this code is for CTP - 150, java CTP 150 Computer Science 1 Lab Assignment (100 points): In

 Also Include Javadoc comments in the code, this code is for CTP - 150, java

imageimageimage

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here is a possible implementation for the given requirements import javaio import javautil class InvalidYearException extends Exception public InvalidYearExceptionString message supermessage class Inv... 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_2

Step: 3

blur-text-image_3

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

Data Modeling and Database Design

Authors: Narayan S. Umanath, Richard W. Scammel

2nd edition

1285085256, 978-1285085258

More Books

Students also viewed these Programming questions

Question

Summarize the findings of psychotherapy efficacy studies.

Answered: 1 week ago