Find Jobs
Hire Freelancers

Write some Software

$12-30 SGD

Selesai
Disiarkan lebih dari 9 tahun yang lalu

$12-30 SGD

Dibayar semasa penghantaran
This question is based on contents covered in Chapters 4 & 5 of the textbook. Examine the description on the game, Elimination and answers the questions that follow: Elimination is a one-player game. The board consists of a set of 12 tiles, number 1 through 12. The player rolls a pair of dice and removes tile based on the numbers shown on the dice. For each roll, the player can remove either the two tiles corresponding to the numbers shown on the dice or a single tile corresponding to the sum of the numbers on the dice. If the same number appears on both dice, the player can remove only the tile corresponding to the sum of the dice. Play continues until the player cannot make a legal move or all the tiles have been removed. The player score is the sum of the remaining tiles. See sample output where the letter ‘E’ denotes that it is not being removed. When the tile is being removed, it is denoted as ‘X’. A random number generator is used to generate the dice number SIM UNIVERSITY Tutor-Marked Assignment – Page 6 of 7 (a) Develop the following functions: (i) void initializeBoard(char[]) This function traverses the array of character (pass-in argument) and initializes each element to ‘E’. There is a total of 12 elements. This 12 elements form the board game. (3 marks) (ii) void displayBoard(char []) This function traverses the array of character (pass-in argument) and displays each element on the board. (3 marks) (iii) int scoreGame(char[]) This function traverses the array of character (pass-in argument) and accumulates the score if it is not being removed. (5 marks) (iv) bool removeTile(char, int, int, char[]) This function takes in the choice (D or S) and the two dice numbers and the board as input arguments. When the move is legal and the tile is available for removal, it removes the tile according to the choice by marking the tile as ‘X’. Returns true if the move is successful. (5 marks) (b) The program uses the functions written in Part (a) to play the game. Using the software development cycle, analyze the problem and write pseudo code to show the steps on how to solve this problem. The pseudo code shows only the main program. Each function call is shown as a step. (10 marks) (c) Develop C++ code to implement the pseudo code you have developed in Part (b). (9 marks)
ID Projek: 6361778

Tentang projek

2 cadangan
Projek jarak jauh
Aktif 10 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
i'll complete this in just one day ... i know c++,c, matlab. i ahve done questions like this during my college .....
$21 SGD dalam 1 hari
5.0 (1 ulasan)
0.5
0.5
2 pekerja bebas membida secara purata $53 SGD untuk pekerjaan ini
Avatar Pengguna
Hello, sir. I have read your description. I can do your project. Thanks. Regards.
$85 SGD dalam 1 hari
5.0 (4 ulasan)
3.3
3.3

Tentang klien

Bendera SINGAPORE
Singapore, Singapore
5.0
5
Kaedah pembayaran disahkan
Ahli sejak Ogo 23, 2014

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.