Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 (20 points] Implement the class Student only. The code of the classes GradStudent and UndergradStudent is provided below. Student - id: int -

image text in transcribed

Question 1 (20 points] Implement the class Student only. The code of the classes GradStudent and UndergradStudent is provided below. Student - id: int - name: String - courses: ArrayList + Student(id: int, name: String) + getId(): int + getName(): String + setId(id: int): void + setName(name: String): void + getCourses():ArrayList + addCourse(cName: String): void + dropCourse(cName: String): void + toString(): String GradStudent UndergradStudent nbOfCredits Earned: int + UndergradStudent(id:int, name: String, nbOfCredits Earned: int) + getNbOfCredits Earned(): int + setNbOfCreditsEarned(n: int): void + toString(): String - foundInternship: boolean + GradStudent(id:int, name: String, found Internship: boolean) + getFoundInternship(): boolean + setFoundInternship(f:boolean): void + toString(): String A. The Student class is characterized by three data fields: an int id, a String name, and an array list of String courses. Write the following methods: a) A constructor to initialize the id and the name data fields. b) Getters and setters (as shown in the UML). c) addCourse method that takes as parameter the name of the course to be added to the array list. d) dropCourse method that takes as parameter the name of the course to be deleted from the array list. e) A toString method to return information about all data fields. For Example: Student id: 9000123, name: Khaled Haddad, Courses Enrolled: CSCI250, CSCI250L, CSC200, NUTR 100

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

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

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

8. Satyam Computer Services Limited

Answered: 1 week ago

Question

2. Explain how the role of training is changing.

Answered: 1 week ago

Question

7. General Mills

Answered: 1 week ago