Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to write a Java program and need help. These are the parameters: Create a CourseException class that extends Exception and whose constructor receives
I need to write a Java program and need help. These are the parameters:
Create a CourseException class that extends Exception and whose constructor receives a String that holds a college courses department for example, CIS a course number for example, and a number of credits for example, Save the file as CourseException.java. Create a Course class with the same fields and whose constructor requires values for each field. Upon construction, throw a CourseException if the department does not consist of three letters, if the course number does not consist of three digits between and inclusive, or if the credits are less than or more than Save the class as Course.java. Write an application that establishes an array of at least six Course objects with valid and invalid values. Display an appropriate message when a Course object is created successfully and when one is not. Save the file as ThrowCourseException.java.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started