Question: OBJECT-ORIENTED PROGRAMMING Problem 1: In the market there are different types of printers such as laserjet, deskjet, dot matrix, ..etc. All these printers can be

OBJECT-ORIENTED PROGRAMMING

Problem 1:

In the market there are different types of printers such as laserjet, deskjet, dot matrix, ..etc. All these printers can be represented as different sub classes under the printer class. For example, laserjet printer is a printer, deskjet printer is a printer, and dotmatrix printer is a printer.

Your task is to demonstrate how can polymorphism be utilized between printer super class and laserjet, deskjet, and dotmatrix sub classes. Explain your answer and implement it in code.

Problem 2:

Student class has the following attributes and methods.

String name;

Int studentId;

String [] coursesRegistered; // courses registered by the student this semester. Maximum 4.

Your task is to create an array of type Student that holds the students objects. Then create a method that print each student information (name, studentId, and coursesRegistered). Students array cannot be less than a size of 5.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!