Suppose that the application requires you to model students. A student has a name and an address. You are required to keep track of the courses taken by each student, together with the grades (between 0 and 100) for each of the courses. A student shall

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Question 01: Implement the following UML class diagram.
Student
-name:String
-address:String
-numCourses: int - 0
-courses:String[30] = {}
-grades:int[30] - (}
+Student (name:String, address:String)
+getName ():String
+getAddress():String
+setAddress (address:String):void
+tostring():String •-
+addCourseGrade(course:String,grade:int):void
+printGrades ():void
+getAverageGrade():double
"name (address)"
"name coursel:grade1, course2:grade2,..."
Suppose that the application requires you to model students. A student has a name and
an address. You are required to keep track of the courses taken by each student,
together with the grades (between 0 and 100) for each of the courses. A student shall
Transcribed Image Text:Question 01: Implement the following UML class diagram. Student -name:String -address:String -numCourses: int - 0 -courses:String[30] = {} -grades:int[30] - (} +Student (name:String, address:String) +getName ():String +getAddress():String +setAddress (address:String):void +tostring():String •- +addCourseGrade(course:String,grade:int):void +printGrades ():void +getAverageGrade():double "name (address)" "name coursel:grade1, course2:grade2,..." Suppose that the application requires you to model students. A student has a name and an address. You are required to keep track of the courses taken by each student, together with the grades (between 0 and 100) for each of the courses. A student shall
not take more than 30 courses for the entire program. You are required to print all
course grades, and also the overall average grade.
Methods Description:
Class: Student
addCourseGrade(course : String, grade : int)
This method appends the given
course and grade into the courses
and grades arrays, respectively.
printGrades() : void
It prints the grades of the courses
taken by a student in the following
format:
Course 1: Grade 1
Course 2: Grade 2
getAverageGrade() : double
This method returns the average
grade of all the courses taken by a
student.
Perform the following tasks.
SI
Tasks
Expected Output
1. Create a Student object with the following
information.
Name: Raihan Ahmed
Address: Mirpur
2. Print the student info using the toString() method. Raihan Ahmed (Mirpur)
3. Add the following courses and grades.
CSE115 --- 89
CSE215 -- 57
CSE225 -- 96
4. Print the grades of the courses.
CSE115: 89
CSE215: 57
CSE225: 96
5. Print the average grade.
Average Grade: 80.67
Transcribed Image Text:not take more than 30 courses for the entire program. You are required to print all course grades, and also the overall average grade. Methods Description: Class: Student addCourseGrade(course : String, grade : int) This method appends the given course and grade into the courses and grades arrays, respectively. printGrades() : void It prints the grades of the courses taken by a student in the following format: Course 1: Grade 1 Course 2: Grade 2 getAverageGrade() : double This method returns the average grade of all the courses taken by a student. Perform the following tasks. SI Tasks Expected Output 1. Create a Student object with the following information. Name: Raihan Ahmed Address: Mirpur 2. Print the student info using the toString() method. Raihan Ahmed (Mirpur) 3. Add the following courses and grades. CSE115 --- 89 CSE215 -- 57 CSE225 -- 96 4. Print the grades of the courses. CSE115: 89 CSE215: 57 CSE225: 96 5. Print the average grade. Average Grade: 80.67
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY