1. Engineering
  2. Computer Science
  3. problem 1 70 points write a class called student containing...

Question: problem 1 70 points write a class called student containing...

Question details

Problem 1 (70 points) Write a class called Student containing name, student ID (8 digits), and list of courses and the corresponding grades. To represent courses and grades you can simply use two arrays of the same size; one being a String array for course names, the other one being an int array for grades (for simplicity assume grades are integers between 0-100) such that the first element in the grades array represents the grade for the first element in the course-name array, and so on. Assume there are at most 5 possible courses. Write a constructor(s) for the class. Write get and set methods for the class fields. Write a displayO method that prints students name on the first line of output and pairs of <course_name grade> on the following lines. Write a toString0 method that returns a String containing students full name and ID in format: name(ID), such as student1(12345678) Now, write a StudentDemo class with a main method to run/test your program. In the main0 method create two Student objects and set the following information using the implemented methods. Then, call display and toString) for both objects. Name ID Course Names Grades student 12345678 [CMPSCI, CMPSC2] Student2 23456781 [CMPSCI, CMPSC2, CMPSC31175, 90,95 (68, 83] class Student define fields and methods here public class StudentDemo public static void main(String] args) write your code for the main function
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution