Kizspy. meQuestion 3: (2 marks)
Write a class named Singer with the following information:
Where:
Singer
- singerld: int
- name: String

Singer() - default constructor

Singer(singerId: int,
numberOfSongs:
name: String,
int)
parameterized
-numberOfSongs: int
+ Singer()
+ Singer(singerId: int, name: String,
numberOfSongs: int)
+ setters & getters
+ toString(): String
constructor, which sets values to singerld, name,
numberOfSongs.

setters & getters: write the setters and getters of
the fields.

toString(): String - returns a string format that
contains all the information of the Singer:
singerld, name, numberOfSongs.
Write a class SingerList which extends from ArrayList (ArrayList is a collection) with the following
information:
SingerList
+ getSingerById(id: int): Singer
+countSingersByNumberOfSongs(value: int):
int
Where:

getSingerById(id: int): Singer returns
the Singer associated with the specified
id. If there is no Singer in the list whose
singerld matches the id, it returns null
value.

countSingersByNumberOfSongs(value:
int): int returns the count of singers
with the number of songs greater than or
equal to value
Hints: to declare the SingerList class, you can use the following statement:
Zoom
+ 100%
Close