Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do in Java please. If you provide the code AND the screenshot, then I will give thumbs up :) package demo; class Student{ private String

Do in Java please. If you provide the code AND the screenshot, then I will give thumbs up :)

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

package demo;

class Student{ private String undergraduateStudent; private String GraduateStudent; private int[] tests; private int average; }

class UndergraduateStudent{ public class UndergraduateStudent extends Student {

private String undergraduateStudent;

// Constructors do not return anything. public undergraduateStudent() { super(); undergraduateStudent = Jerry; }

// Again, constructors do not return anything. public UndergraduateStudent(String undergraduateStudent, int[] tests, int average) { super(undergraduateStudent, tests, average); String undergraduateStudent = undergraduateStudent; }

public int getUndergraduateStudent() { return undergraduateStudent; }

@Override public void average() { int average = getAverage();

if (average >= 60) { setAverage("Pass"); } else ("Did not meet criteria for admissions") { } } } } }

class GraduateStudent{ public class GraduateStudent extends Student {

private String graduateStudent;

// Constructors do not return anything. public graduateStudent() { super(); graduateStudent = Jerry; }

// Again, constructors do not return anything. public GraduateStudent(String graduateStudent, int[] tests, int average) { super(graduateStudent, tests, average); String graduateStudent = graduateStudent; }

public int getGraduateStudent() { return graduateStudent; }

@Override public void average() { int average = getAverage();

if (average >= 70) { setAverage("Pass"); } else ("Did not meet criteria for admissions") { } } } }

class Tester {

public static void main(String[] args) { UndergraduateStudent undergraduateStudent = new UndergraduateStudent("Philip"); undergraduateStudent.setAverage(0, 70); undergraduateStudent.setAverage(1, 69); undergraduateStudent.setAverage(2, 71); undergraduateStudent.setAverage(3, 55); undergraduateStudent.generateAverage(); System.out.println("Student name: "+undergraduateStudent.getAverage()); System.out.println("Result: "+undergraduateStudent.getAverage()); System.out.println(); GraduateStudent graduateStudent = new GraduateStudent("Jerry"); graduateStudent.setTestScore(0, 70); graduateStudent.setTestScore(1, 69); graduateStudent.setTestScore(2, 71); graduateStudent.setTestScore(3, 55); graduateStudent.generateResult(); System.out.println("Student name: "+graduateStudent.getAverage()); System.out.println("Result : "+graduateStudent.getAverage()); //Create more objects of the classes for testing your code } }

Anchor College offers both graduate and postgraduate programs. The college stores the names of the students, their test scores and the final result for each student. Each student has to take 4 tests in total. You need to create an application for the college by implementing the classes based on the class diagram and description given below. Student studentName: String testScores: int[] a testResult: String Student(studentName: String) generate Result : void set TestScore(test Numbers int, testScore int): void get StudentName : String setStudentName(studentName String: void get TestScores: int! get TestResult(): String set TestResultitestResult: String: void Undergraduate Student Undergraduate Student student Name: String) generateResult(): void GraduateStudent Graduate Student studentName: String) generateResult(); void Method Description Student 60 Pass GraduateStudent GraduateStudent(String studentName) Initialize the instance variable studentName with the value passed to the constructor and other instance variables to the default values generateResult() Implement the abstract method of Student class by setting the value of testResult based on the below details Average Score Result >=70 Pass

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_2

Step: 3

blur-text-image_3

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 Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

Name the four basic types of construction contracts.

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago