Analytics Programming - IT Assignment Help

Download Solution Order New Solution
Assignment Task

 

Project Description

In this assignment there are 4 parts. For each part you should:

• Write the appropriate code.

• Include comments within the code to explain the algorithm.

• Test the code to ensure its correctness.

• Format and structure the code to maximise its readability.

 

Project Tasks
Ultra Indoor Cricket is a new form of cricket that has grown from a form of backyard cricket, where each team consists of one player, but many teams can play at once (at least two teams are needed).
• At any time, there is one bowler and one batsman and any other players are fielders.
• The batsman bats for a set number of overs. where each over consist of six balls and each of the overs to be bowled are evenly divided between the remaining players (e.g. 6 overs for one player, 3 for two, 2 for three).
• Due to the game being indoor, no more that one run can be run, but 2, 3, and 5 runs can be awarded for hitting certain targets.
• If a batsman is given out, they lose five runs, and the batsman continues to bat (so it is possible to finish with a negative number of runs).
• Finally, any illegal deliveries bowled subtract one run from bowler’s batting score and add three to the batsman’s score; a batsman cannot not score runs from an illegal delivery and unlike other forms of cricket an extra ball is not bowled.
The winner is the player with the most runs after all players have batted.
The Ultimate Indoor Cricket League want you to write a program to help keep track of games. They have asked you to complete the following tasks.

Initialising Player State
For each player, we must record the player’s name, the number of times they scored 0, 1, 2, 3 and 5 runs, the number of illegal balls bowled, and the number of times they were given out.
Write a function initialisePlayer that takes a player name, and creates and returns a data structure (such as a list) that provides a player’s state at the beginning of the game (with all counts set to zero).
Write another function playerScoreBoard that takes a player’s data structure and prints out the contents of the list and the players total number of runs (calculated from the list contents) to provide a scoreboard for the player.
The code below shows the how the functions should be called and the desired output.
playerA <- initialisePlayer("T Smith")
playerB <- initialisePlayer("N Starc")
playerScoreBoard(playerA, header = TRUE)
Name 0s 1s 2s 3s 5s X Out Tot
T Smith 0 0 0 0 0 0 0 0
playerScoreBoard(playerB)
N Starc 0 0 0 0 0 0 0 0
Show that your code produces the same results.

 

This IT Assignment has been solved by our IT experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.