Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java - College Course

dickersonka
dickersonka 


Create a class named CollegeCourse that includes data fields that hold the department (for example, ENG), the course number (for example, 101), the credits (for example, 3), and the fee for the course (for example, $360). All of the fields are required as arguments to the constructor, except for the fee, which is calculated at $120 per credit hour. Include a display() method that displays the course data. Create a subclass named LabCourse that adds $50 to the course fee. Override the parent class display() method to indicate that the course is a lab course and to display all the data. Write an application named UseCourse that prompts the user for course information. If the user enters a class in any of the following departments, create a LabCourse: BIO, CHM, CIS, or PHY. If the user enters any other department, create a CollegeCourse that does not include the lab fee. Then display the course data. Save the files as CollegeCourse.java, LabCourse.java, and UseCourse.java. Attachments
Tags Clarifications

Answers

Java - College Course - Solution

dickersonka
dickersonka 



Attached is the solution to the Java - College Course assignment including source and comments Attachments
CollegeCourse_screenshot2.png (3 K) Download Preview

CollegeCourse.zip (1 K) Download

Preview
* Get department * @return department */ public String getDepartment() { return department; } /** * Get course number * @return course number */ public int getCourseNumber() { return courseNumber; } /** *

Preview
course = null; //determine if lab if(department.equalsIgnoreCase("BIO") || department.equalsIgnoreCase("CHM") || department.equalsIgnoreCase("CIS") || department.equalsIgnoreCase("PHY")){ //create lab course course = new LabCourse(department, courseNumber, credits); }else{ //create college course course = new

Preview
fee super.fee += 50; } /** * Display course information */ public void display(){ //display lab course System.out.print("Lab Course - Department: " +

CollegeCourse_screenshot1.png (3 K) Download Preview

Screenshots
Screenshot
Screenshot
Purchase Answer