Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the following tasks in Java within the lab time using NetBeans. 1. Create a project named as Lab4_your FirstName_yourlD with three classes University, Student

image text in transcribed

Complete the following tasks in Java within the lab time using NetBeans. 1. Create a project named as "Lab4_your FirstName_yourlD" with three classes University, Student and Course. 2. The first class called Course with: . The name (Cname) as a string. The address (CID) as a long. The class must also have the required methods. All the parameters must have the same names as the data members they will be assigned to and identified using this. 3. The second class called Student with: The student name (Sname) as a String. The student ID (SID) as a long. Array of courses (courses) as an array of Course. The class must also have the required methods. All the parameters must have the same names as the data members they will be assigned to and identified using this. 4. The third class called University with a main method. In the main method, ask the user to define the number of students to be created and then create an array of students. Create a loop to fill in the students. Ask the user to define the number of the courses for each student and create the array of courses. Create a loop to fill in the courses information and add it to the object student. Print the array of students including their courses (two for loops). please enter the total number of students: 2 please enter student name: Amal please enter student ID: 234 please enter the total number of courses for this student: 1 please enter the course name: CS1 please enter course ID: 1 please enter student name: Maha please enter student ID: 432 please enter the total number of courses for this student: 2 please enter the course name: CS1 please enter course ID: 1 please enter the course name: CS2 please enter course ID: 2 Student{name=Amal, SID=234} Course{Sname=CS1, SID=1} Student{name=Maha, SID=432) Course{Sname=CS1, SID=1} Course{Sname=CS2, SID=2}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions