Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sample output: the word Undergraduate or Graduate will be displayed using instanceof operator Undergraduate: id: 123 gpa: 3.5 status: Honor Graduate: id: 734 gpa: 3.7

image text in transcribedimage text in transcribed

Sample output: the word Undergraduate or Graduate will be displayed using instanceof operator Undergraduate: id: 123 gpa: 3.5 status: Honor Graduate: id: 734 gpa: 3.7 status: Good Graduate: id: 778 gpa: 2.4 status: Probation Undergraduate: id: 234 gpa: 2.5 status: Good Undergraduate: id: 524 gpa: 1.5 status: Probation ICS 108 - Object-Oriented Programming Lab # 13 - Abstract Classes Objectives: In this lab, the following topic will be covered: 1. Abstract Classes Task Design an abstract class Student. A student has the following data fields: Id and GPA. The student class has an abstract method getStatus that returns the status as a string. Design two subclasses Undergraduate and Graduate. The status of the graduate student is good if his GPA is 3.0 or above otherwise it is probation. The undergraduate's status is honor if his GPA is 3.0 or above, good if his GPA is 2.0 or above, probation otherwise. Write a test program that declares an array of type Student. Make some elements Undergraduate objects and some elements Graduate objects with random values. For every student, print his Id, GPA, and status. Notes: Save every class in a separate file. Data fields should be private. Constructors and methods should be public

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

What is a financial feasibility analysis?

Answered: 1 week ago