You are on page 1of 6

CSC2303 Spring 22

Midterm 2 (duration 50mn) Student Name ____________________________

Requirements

Consider the following details about Student objects:


Course type Characteristics

Undergraduate student Name, gpa, isHonors


Place on probation (if gpa<2.0)
Graduate student Name, gpa, thesis topic
Place on probation (if gpa<3.0)

1. Using the best practices learnt in class, design and implement a hierarchy of student classes
with the requirements above.
2. Test your code in a class called StudentsApp:
- Implement a behavior called processStudents to process an array of students, it should:
- Display the student’ state polymorphically.
- Display the student’ probation status polymorphically.
- Display the thesis topic for graduate students.
- Display whether the student is an honors student for undergraduate students.
o Implement the main behavior:
- It should create student objects (you can use hard coded values) corresponding to the
different types in your hierarchy and process students using the behavior
processStudents.

1
// Student definition goes here

2
// undergraduate student definition goes here

3
//Graduate student definition goes here

4
public Class StudentApp {

public static void main (String[] args){//


//create few student objects and call processStudents

5
private static void processStudents (Student[] students) {

You might also like