Photo AI

A music album is a compilation of many songs recorded by one artist - NSC Information Technology - Question 3 - 2024 - Paper 1

Question icon

Question 3

A-music-album-is-a-compilation-of-many-songs-recorded-by-one-artist-NSC Information Technology-Question 3-2024-Paper 1.png

A music album is a compilation of many songs recorded by one artist. Music albums are evaluated every 10 weeks to determine the number of points earned, based on the... show full transcript

Worked Solution & Example Answer:A music album is a compilation of many songs recorded by one artist - NSC Information Technology - Question 3 - 2024 - Paper 1

Step 1

3.2.1 - Instantiate album object

96%

114 rated

Answer

To instantiate an album object, extract the album title and artist name from the user interface inputs. Use these values to create a new instance of the Album class:

var
  objAlbum: Album;
begin
  objAlbum := Album.Create(AlbumNameEdit.Text, ArtistNameEdit.Text);
end;

Step 2

3.2.2 - Calculate points

99%

104 rated

Answer

Call the updatePoints method using the correct parameters which represent the number of albums sold, downloads, and streams. Ensure all values are converted to the correct type before passing them as arguments:

var
  albumsSold, downloads, streams: integer;
begin
  albumsSold := StrToInt(AlbumsSoldEdit.Text);
  downloads := StrToInt(DownloadsEdit.Text);
  streams := StrToInt(StreamsEdit.Text);
  objAlbum.updatePoints(albumsSold, downloads, streams);
end;

Step 3

3.2.3 - Set ranking

96%

101 rated

Answer

Extract the number of weeks from the input and convert it to an integer to call the setRanking method:

var
  numWeeks: integer;
begin
  numWeeks := StrToInt(WeeksEdit.Text);
  objAlbum.setRanking(numWeeks);
end;

Step 4

3.2.4 - Display album details

98%

120 rated

Answer

Use the toString method to display album details in the designated RichEdit component and call determineStatus to check and display the ranking status:

RichEdit1.Lines.Add(objAlbum.toString);
objAlbum.determineStatus;

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;