Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Section 4. Programming exercises An Inheritance principle is used to explore and extend the Course class. The UML of the Course is presented below: Part

image text in transcribed
image text in transcribed
image text in transcribed
Section 4. Programming exercises An Inheritance principle is used to explore and extend the Course class. The UML of the Course is presented below: Part 4.1. Implement the abstract class Course strictly according to its UML one-to-one (do not include anything extra, do not miss any data fields or methods). Add comments to your program (mark where data fields, constnuctors, getters, setters and toString0 are, which method is abstract or static (if any). No methods should have empty bodies. Part 4.2. Write a subclass of Course, called a HybridCourse. The UML of the HybridCourse is presented below HybridCourse - percentOfRemoteLeaming : int +HybridCourse() +HybridCourse(courseName : String, sectiomNumber : int, instructorName : String, percentOfRemoteLearning : int) +getCapacity() : int + getPercentOfRemoteLearning() : int + setPercentOfRemoteL earning(percentOfRemote Learning : int) : void + tostring( ) : String Override the getCapacity0 method, so it returns a number 40. Add comments to your class. No methods should have empty bodies. Part 4.3. Write a main0 method. Assume it is implemented inside or the course cidss. a) Create a new HybridCourse using a no-arg constructor and assign it to the-object reference variable of typeCourse. b) Set the value of numberOfStudentsEnrolled to 20. c) Create a new HybridCourse using the second constructor, presented on the UML. d) Increment the numberOfStudentsEnrolled by 18. e) Display a description of all objects you created on the Console. f) Display the total number of Enrolled Students

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Step: 3

blur-text-image

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

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions