Computers and Technology, 21.12.2020 19:30 Arealbot
Create a CourseException class that extends Exception and whose constructor receives a String that holds a college course’s department (for example, CIS), a course number (for example, 101), and a number of credits (for example, 3).
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 100 and 499 inclusive, or if the credits are less than 0.5 or more than 6.
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.
These must be in three different "files" as well as being written in java
Here is the code so far:
//Course. Java//
public class Course {
String department;
int courseNumber;
double credits;
final int DEPT_LENGTH = 3;
final int LOW_NUM = 100;
final int HIGH_NUM = 499;
final double LOW_CREDITS = 0.5;
final double HIGH_CREDITS = 6;
public Course() {
// Write your code here
}
public Course(String dept, int num, double creditValue) throws CourseException {
// Write your code here
}
public String toString() {
// Write your code here
}
}
//CourseException. Java//
public class CourseException extends Exception {
public CourseException(String s) {
return
}
}
//ThrowCourseException. Java//
public class ThrowCourseException {
public static void main(String[] args) {
// Write your code here
}
}
Answers: 3
Computers and Technology, 22.06.2019 11:00
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
Create a CourseException class that extends Exception and whose constructor receives a String that h...
History, 28.07.2019 22:40
History, 28.07.2019 22:40
History, 28.07.2019 22:40
Mathematics, 28.07.2019 22:40
Mathematics, 28.07.2019 22:40
History, 28.07.2019 22:40
Social Studies, 28.07.2019 22:40
Social Studies, 28.07.2019 22:40
Business, 28.07.2019 22:40
History, 28.07.2019 22:40
Geography, 28.07.2019 22:40
Physics, 28.07.2019 22:40