1. Create a class called MyFriends, with the following attributes variables: a. studentArray(Student[]) 2. 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 …”
1. Create a class called MyFriends, with the following attributes variables:
a. studentArray(Student[])
2. 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”
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images