1. Create a class called Student, with the following attributes/variables: a. studentName (String) b. studentNumber (int)s c. regYear(long) d. faculty(String) e. department(String) 2. Add the following methods in Student: a. accessors and mutators for all variables b. toString method i. Formulate your toString so that it only shows studentName, studentNumber and faculty 3. Create a class called MyFriends, with the following attributes variables: a. studentArray(Student[]) 4. Add the following methods in MyFriends: a. fillArray i. Using scanner ask how many students does the user want to input ii. Capture user input for all of his friends (Of course we are assuming all your friends would be similar UWC students, go ask around and meet new friends, also preferably not in the same Computer Science department … if possible … only if possible) b. main i. Call the fillArray method ii. Count how many Computer Science students iii. If half or more students are Computer Science students, then display “You … need more friends …” iv. Otherwise display “Nice, diversity is good”
1. Create a class called Student, with the following attributes/variables:
a. studentName (String)
b. studentNumber (int)s
c. regYear(long)
d. faculty(String)
e. department(String)
2. Add the following methods in Student:
a. accessors and mutators for all variables
b. toString method
i. Formulate your toString so that it only shows studentName,
studentNumber and faculty
3. Create a class called MyFriends, with the following attributes variables:
a. studentArray(Student[])
4. Add the following methods in MyFriends:
a. fillArray
i. Using scanner ask how many students does the user want to input
ii. Capture user input for all of his friends
(Of course we are assuming all your friends would be similar
UWC students, go ask around and meet new friends, also
preferably not in the same Computer Science department … if
possible … only if possible)
b. main
i. Call the fillArray method
ii. Count how many Computer Science students
iii. If half or more students are Computer Science students, then
display “You … need more friends …”
iv. Otherwise display “Nice, diversity is good”
Step by step
Solved in 5 steps with 2 images