MTD215 Singapur University Application of C++ programming in Multimedia Paper Please answers all the question in the attachment. will send you the study guide if needed MTD215
Application of C++ in Multimedia
Tutor-Marked Assignment
July 2019 Presentation
MTD215
Tutor-Marked Assignment
TUTOR-MARKED ASSIGNMENT (TMA)
This assignment is worth 15% of the final mark for MTD215 Application of C++ in
Multimedia.
The cut-off date for this assignment is 14 October 2019, 2355 hrs.
Note to Students:
You are to include the following particulars in your submission: Course Code, Title of the
TMA, SUSS PI No., Your Name, and Submission Date.
Question 1
Apply C++ language to program a Mastermind game. Some of you may be familiar with the
game where the player is to guess the colours of four hidden pegs. Our program will use char
(between a and h) to simulate the pegs.
You should use arrays to store both the hidden codes and the players guesses. Write
individual functions to implement each of the following specification of the game.
(a)
You should start the game with a welcome message. It should include your name, PI
number and a short introduction. Figure Q1(a) shows a sample welcome message.
Figure Q1(a): Welcome Message
(4 marks)
(b)
Initialisation Your program needs to declare arrays and initialise them with
appropriate values for both the hidden codes and the players guesses. You need to
use a random generator to simulate the hidden codes.
(4 marks)
(c)
Display Your program needs to display the players guesses and the pins that are
awarded. Figure Q1(c)(i) shows the initial display after the welcome message. Figure
Q1(c)(ii) shows the result after three guesses.
SINGAPORE UNIVERSITY OF SOCIAL SCIENCES (SUSS)
Page 2 of 7
MTD215
Tutor-Marked Assignment
Figure Q1(c)(i): Initial display
Figure Q1(c)(ii): After Three Guesses
(4 marks)
(d)
Awarding Pins your program should compare the players input against the hidden
codes. If an input matches a hidden code and is in the correct position, then a black
pin is awarded. If an input matches a hidden code but is in a wrong position, then a
white pin is awarded.
No pins are awarded if none of the inputs matches any of the hidden codes. If there
are duplicate letters in the input, there must be a one-to-one match for a pin to be
awarded.
(8 marks)
(e)
Playing the game Your program should prompt the player to input the letters. It
should validate that the letters are between a and h inclusive. A final message is
displayed when the game ends i.e. either the player wins or loses the game.
Figure Q1(e)(i) and Figure Q1e(ii) show the message displayed respectively if the
player wins or loses the game.
Figure Q1e(i): Player wins the game
SINGAPORE UNIVERSITY OF SOCIAL SCIENCES (SUSS)
Page 3 of 7
MTD215
Tutor-Marked Assignment
Figure Q1e(ii): Player loses the game
You should also write a main() function to run the program by calling the functions
you have implemented above..
(10 marks)
Question 2
A SimpleQuaternion can be represented by four data members namely real, vi, vj
and vk. All data members are integers.
Identify suitable coding modules for the SimpleQuaternion class with the following
specifications:
(a)
Define the four data members: real, vi, vj and vk.
(3 marks)
(b)
Implement a parameterised constructor that receives four arguments that represent the
values of real, vi, vj and vk respectively. The constructor will initialise the three
data members with the arguments with the following rules.
(5 marks)
(c)
Overload the
Purchase answer to see full
attachment
Economic Debate- Progressive Income Tax For this Economic Debate, we are going to discuss the…
TOPIC: Going Global Discussion Thread 1 (initial post due Wednesday for full credit) Please note:…
Assignment Topic This week will culminate in the creation of a narrated PowerPoint to create…
The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted…
you need to post your 2-page information flier to share with your Final Project Group.…
discussion: Discuss the methods used at your company to measure and ensure quality products and…