Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create University.java to display an array of information about students and faculty at your university. Specifications Create an array of 5 students and instructors object

Create University.java to display an array of information about students and faculty at your university.

Specifications

Create an array of 5 students and instructors object to store multiple instances. (Review and use the code from the previous week)

Create a Person class is abstract with a method called personalInterest(). The class stores first name, last name, and email address. Create a class named Student that extends the Person class and overrides the abstract method. This class stores a student id, major, student level (freshman, sophomore, junior, or senior).

Create a University class with the main method.

Student (example data)

Name: Frank Jones Email: frank44@hotmail.com Student id: M10293 Major: Business Level: Sophomore

Create a class named Instructor that inherits from the Person class. This class stores a social security number, subject area taught and number of years worked as an instructor and overrides the abstract method.

Faculty (example data)

Name: Anne Price Email: anne@nctc.edu Social security number: 111-11-1111 Subject area: Physics for 3 years.

Ask if you want to see the array/ist of student or instructor information. Based on the response, display the appropriate information. The individual subclasses should handle the information for the student and the instructor.

--------------------

Further clarification:

In main, ask if they are a student or an instructor. Create the appropriate object and update the attributes. Then based on their response for a student or instructor, you will either go to the Student class or the Instructor class and display the information.

Create an array of 5 student and instructor objects to store multiple instances.

Example output for the program on inheritance:

List students or instructors: students

OUTPUT: Name: Frank Jones Email: frank44@hotmail.com Student id: M10293 Major: Business Level: Sophomore

Name: John Smith Email: john55@g.com Student id: J55294 Major: English Level: Freshman

List students or instructors: instructors

OUTPUT: Name: Anne Price Email: anne@.edu Social security number: 111-11-1111 Subject area: Physics for 3 years.

Name: Kris Moore Email: kmoore@.edu Social security number: 333224444 Subject area: Statistics for 11 years.

---------------------------

Class Layout:

class Person { }

class Student extends Person { }

class Instructor extends Person { }

public class University {

main () {

Student [] student = new Student[5]; Instructor [] instructor = new Instructor[5];

// question: add student or instructor? // create student object and populate the data in the object // create instructor object and populate the data in the object // question: Ask if you want to see the students or the instructors? // Display either the student information or the instructor information } }

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_2

Step: 3

blur-text-image_step3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago