联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2023-05-25 08:43

COS10029 – Fundamentals of Programming

©Copyright: Swinburne University of Technology CRICOS: 0011D TOID: 3059

Week 11 Lab Page 1 of 2

Fundamentals of Programming

Week 11 – Lab exercises (Submit all tasks – submit HD task separately)

Task 11.1 Write a program for reading information from a data file and saving a summary report into

another data file for the average value, the maximum value, and the minimum value. A data file named

'price.dat’ contains the price of different items, the first record in the price data file contains an integer that

specifies the number of records that follow. Each of the following lines contains an id and the

corresponding price.

10

1 1000.25

2 55.25

3 9999.99

4 33.45

5 2000.00

6 1588.88

7 1699.99

8 14898.25

9 13734.21

10 13523.24

The output of the problems should be saved into another data file, named 'Output.dat'. With the following

data:

Number of price readings: 10

Maximum price: 14898.30

Minimum price: 33.45

Average price: 5853.35

Task 11. 2 HD Task – GUI Music Player

For this task, you are required to create GUI (Graphical User interface) based Music Player using SplashKit.

The program should read in album and track information from a predefined file. The user should then be

able to view the albums and select an album, then view the tracks and select a track to play.

The information read from the file can be:

• Number of Albums

• Album title

• Artist

• Artwork file name (place your artwork in an /images folder inside the Resources folder)

• The number of tracks

• The title of each track

• The file location of each track (place your music file in a sounds folder inside the Resources folder - use

.wav files for each track)

Your program should contain file handling, arrays, structs, enums, etc.

COS10029 – Fundamentals of Programming

©Copyright: Swinburne University of Technology CRICOS: 0011D TOID: 3059

Week 11 Lab Page 2 of 2

You are allowed to use your own images and music files(do not upload your images or music

files in Canvas). The user interaction must be entirely through a GUI. Your GUI interface should show all

the albums using either a text description, artwork or both. Users should be able to click on any Album

information (i.e the artwork) and the tracks will be listed. The user should then be able to click on a track to

play that track. The currently playing track must be indicated somehow (e.g. the track could be highlighted

or display a simple text message ‘Now playing ..’). If the user clicks on another track (for the current album

or another album) then any currently playing track should be stopped and the most recently selected track

start playing.

Click here to see the sample run of Music Player.

You must submit the code for the program written in C++ and a screenshot of it running. In addition to that

show the working of your code directly to the tutor or upload a video or link to a video that shows a sample

run of your Music Player.

Note: Refer to https://splashkit.io/ website for different functions that you can use for this task. You

will need to use the following:

path_to_resource( ) – use this to load your music .wav files. It will look in the Resources folder for

files and allows cross-platform file access.

load_music () – this will load the resource at the given path.

play_music() - plays the music file that matches the name once at full volume.

stop_music() - stops all music that is playing.

free_all_music() - releases all of the music files that have been loaded.

You can search “music” on SplashKit website to see all the information required for these functions.


相关文章

版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp