Stuck in the mud is a popular dice game in UK. The game uses five (5) 6-sided dice to play. The players play in turns.
Choose one player to start the game. The player will roll all five (5) dice. If the player rolled any 2s or 5s, the player does not score any points for this throw. The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values.
The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw. Throws without 2s and 5s are added to the previous total score.
Continue in this way until all the dice are stuck. Save the score and pass the dice to the next player.
Players can agree a total number of rounds to play in advance. Total up the score. The player with the highest score wins the game. The following link contains the detail game description: https://www.activityvillage.co.uk/stuck-in-the-mud.
Write a MATLAB program to simulate the Stuck in the Mud game with additional features that can:
• Use five (5) 6-sided dice to automatically play the Stuck in the Mud game against a player.
• Greet the player when the game starts.
• Let the player to choose the number of rounds to play. Take care of the user input to ensure the program will not crash with inputs like 0, 1.2, -1, 999, and so on...
The program should not play if the user enters a 0 or any negative value.
• The program should accurately play the number of rounds specified by the user. The player and the computer play in turns for each round.
• The program can always pick one side to start the game first, either the player side or the computer side. Randomly pick a side to start the rotation is optional.
• Print the current round number clearly in the command window.
• If the player side starts first, the program will automatically roll all five (5) dice for the player. If the player rolled any 2s or 5s, the player does not score any points for this throw. The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values. The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw. Throws without 2s and 5s are added to the previous total score. Continue in this way until all the dice are stuck.
• The dice rolled for the player, the stuck dice, and the scores during the process should clearly be printed in the command window.
• The program then automatically roll all five (5) dice for the computer. Follow the game rules until all five (5) dice are stuck.
• The dice rolled for the computer, the stuck dice, and the scores during the process should also be clearly printed in the command window.
• Accurately track the total scores for the player and the computer.
• After all the rounds have been played, select a winner based on the highest total score. It is also possible that the game ends in a tie.
• Add voice to the game to report the details of the game for the player. o Pre-recorded computer voices, computerVoices.zip, can be downloaded from moodle.
o The following websites can convert any text into voices with downloadable mp3 files. § www.fromtexttospeech.com
§ www.text2speech.org
o If you have a mic, you can also record your own voice using the Windows Sound Recorder.
o MATLAB can play any WMA, MP3, MPEG-4 AAC, WAV, FLAC audio files.
[y,Fs] = audioread('fileName.mp3'); % read sound file
sound(y,Fs); % play sound file
o Additional sound effects are welcome.
• Add voice to greet the player.
• Add voice to ask the player to enter the number of rounds to play.
• Add voice to announce the current round number (i.e., round 1, round 2, and so on…).
• Add voice to announce the current turn (i.e. the player is rolling or the computer is rolling).
• Add voice to announce the current roll number (i.e. roll 1, roll 2, and so on…).
• Add voice to announce each dice rolled.
• Add voice to announce the sum of the score for the current turn after each throw.
• Add voice to announce the number of dice stuck after each throw.
• After one side played, add voice to announce the current total score for the side. For example, 35 points can be announced as three-five.
• After all the rounds are played, add voice to announce the winner or tie.
• Add pause as needed between sentences to ensure one sentence is finished before the next sentence starts.
• Use at least one user-defined function in the program to reduce code repetition.
The finished program can look like the following example. Extra components are always welcome.
Games do not make you violent, lag does.
Got lag? Kill the lag with a dice game. (Play a voice greeting.)
(Play a voice to request the user input.)
Enter the number of rounds to play: 2
ROUND 1!!! (Announce round #1.)
The player starts first: (Announce the player’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 5 1 4 5 6 (Announce rolling 5-1-4-5-6.)
Stuck in the mud: 5 5
Game score: 0 (Announce the score: 0)
Number of dice stuck: 2 (Announce the number of dice stuck: 2)
ROLL 2 (Announce roll #2.)
Rolling: 2 2 2 (Announce rolling 2-2-2.)
Stuck in the mud: 5 2 2 5 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The player scores: 0 (Announce the player score: 0)
The Player Total Scored: 0 (Announce the player total score: 0)
The computer goes next: (Announce the computer’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 2 4 3 5 4 (Announce rolling 2-4-3-5-4.)
Stuck in the mud: 2 5
Game score: 0 (Announce the score: 0)
Number of dice stuck: 2 (Announce the number of dice stuck: 2)
ROLL 2 (Announce roll #2.)
Rolling: 1 2 4 (Announce rolling 1-2-4.)
Stuck in the mud: 2 2 5
Game score: 0 (Announce the score: 0)
Number of dice stuck: 3 (Announce the number of dice stuck: 3)
ROLL 3 (Announce roll #3.)
Rolling: 4 2 (Announce rolling 4-2.)
Stuck in the mud: 2 2 5 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 4 (Announce roll #4.)
Rolling: 5 (Announce rolling 5.)
Stuck in the mud: 2 5 2 5 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The computer scores: 0 (Announce the computer score: 0)
The Computer total scored: 0 (Announce the computer total score: 0)
ROUND 2!!! (Announce round #2.)
The player starts first: (Announce the player’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 2 4 4 2 5 (Announce rolling 2-4-4-2-5.)
Stuck in the mud: 2 2 5
Game score: 0 (Announce the score: 0)
Number of dice stuck: 3 (Announce the number of dice stuck: 3)
ROLL 2 (Announce roll #2.)
Rolling: 2 2 (Announce rolling 2-2.)
Stuck in the mud: 2 2 2 2 5
Game score: 0 (Announce the score: 0)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The player scores: 0 (Announce the player score: 0)
The Player Total Scored: 0 (Announce the computer score: 0)
The computer goes next: (Announce the computer’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 4 4 1 1 1 (Announce rolling 4-4-1-1-1.)
Stuck in the mud:
Game score: 11 (Announce the score: 1-1)
Number of dice stuck: 0 (Announce the number of dice stuck: 0)
ROLL 2 (Announce roll #2.)
Rolling: 1 4 5 6 4 (Announce rolling 1-4-5-6-4.)
Stuck in the mud: 5
Game score: 11 (Announce the score: 1-1)
Number of dice stuck: 1 (Announce the number of dice stuck: 1)
ROLL 3 (Announce roll #3.)
Rolling: 6 5 1 1 (Announce rolling 6-5-1-1.)
Stuck in the mud: 5 5
Game score: 11 (Announce the score: 1-1)
Number of dice stuck: 2 (Announce the number of dice stuck: 2)
ROLL 4 (Announce roll #4.)
Rolling: 2 5 1 (Announce rolling 2-5-1.)
Stuck in the mud: 2 5 5 5
Game score: 11 (Announce the score: 1-1)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 5 (Announce roll #5.)
Rolling: 5 (Announce rolling 5.)
Stuck in the mud: 2 5 5 5 5
Game score: 11 (Announce the score: 1-1)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The computer scores: 11 (Announce the computer score: 1-1)
The Computer total scored: 11 (Announce the computer total score: 1-1)
The computer wins! (Announce the computer wins.)
>>
The program should end when the player wants to play 0 round.
Games do not make you violent, lag does.
Got lag? Kill the lag with a dice game. (Play a voice greeting.)
(Play a voice to request the user input.)
Enter the number of rounds to play: 0
The game ends with a tie (Announce the game ends in a tie.)
>>
The program should be able to handle a negative input.
Games do not make you violent, lag does.
Got lag? Kill the lag with a dice game. (Play a voice greeting.)
(Play a voice to request the user input.)
Enter the number of rounds to play: -1
The game ends with a tie (Announce the game ends with a tie.)
>>
The program should be able to handle a floating point input without crashing.
(The following example takes the floor value of 1.2 and only runs 1 round. )
Games do not make you violent, lag does.
Got lag? Kill the lag with a dice game. (Play a voice greeting.)
(Play a voice to request the user input.)
Enter the number of rounds to play: 1.2
ROUND 1!!! (Announce round #1.)
The player starts first: (Announce the player’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 3 6 2 2 6 (Announce rolling 3-6-2-2-6.)
Stuck in the mud: 2 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 2 (Announce the number of dice stuck: 0)
ROLL 2 (Announce roll #2.)
Rolling: 4 4 4 (Announce rolling 4-4-4.)
Stuck in the mud: 2 2
Game score: 12 (Announce the score: 1-2)
Number of dice stuck: 2 (Announce the number of dice stuck: 2)
ROLL 3 (Announce roll #3.)
Rolling: 3 1 5 (Announce rolling 3-1-5.)
Stuck in the mud: 2 2 5
Game score: 12 (Announce the score: 1-2)
Number of dice stuck: 3 (Announce the number of dice stuck: 3)
ROLL 4 (Announce roll #4.)
Rolling: 6 5 (Announce rolling 6-5.)
Stuck in the mud: 5 2 2 5
Game score: 12 (Announce the score: 1-2)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 5 (Announce roll #5.)
Rolling: 1 (Announce rolling 1.)
Stuck in the mud: 5 2 2 5
Game score: 13 (Announce the score: 1-3)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 6 (Announce roll #6.)
Rolling: 1 (Announce rolling 1.)
Stuck in the mud: 5 2 2 5
Game score: 14 (Announce the score: 1-4)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 7 (Announce roll #7)
Rolling: 5 (Announce rolling 5.)
Stuck in the mud: 5 5 2 2 5
Game score: 14 (Announce the score: 1-4)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The player scores: 14 (Announce the player score: 1-4)
The Player Total Scored: 14 (Announce the player total score: 1-4)
The computer goes next: (Announce the computer’s turn.)
ROLL 1 (Announce roll #1.)
Rolling: 6 5 6 4 2 (Announce rolling 6-5-6-4-2.)
Stuck in the mud: 5 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 2 (Announce the number of dice stuck: 2)
ROLL 2 (Announce roll #2.)
Rolling: 2 4 5 (Announce rolling 2-4-5.)
Stuck in the mud: 2 5 5 2
Game score: 0 (Announce the score: 0)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 3 (Announce roll #3.)
Rolling: 4 (Announce rolling 4.
Stuck in the mud: 2 5 5 2
Game score: 4 (Announce the score: 4)
Number of dice stuck: 4 (Announce the number of dice stuck: 4)
ROLL 4 (Announce roll #4.)
Rolling: 2 (Announce rolling 2.)
Stuck in the mud: 2 5 2 5 2
Game score: 4 (Announce the score: 4)
Number of dice stuck: 5 (Announce the number of dice stuck: 5)
The computer scores: 4 (Announce the computer score: 4)
The Computer total scored: 4 (Announce the computer total score: 4)
The player wins! (Announce the player wins.)
>>
In: Computer Science
QUESTION 5
|
A) $2.03/£ |
||
|
B) $2.05/£. |
||
|
C) $2.07/£ |
||
|
D) The answer depends upon if this is a long or a short call option |
QUESTION 6
|
a) do nothing |
||
|
b) buy dollar |
||
|
c) sell yen |
||
|
d) sell dollar |
QUESTION 7
|
a) matched flow |
||
|
b) currency swap |
||
|
c) back-to-back loan |
||
|
d) credit swap |
QUESTION 8
|
A) forward rate agreement. |
||
|
B) interest rate future. |
||
|
C) interest rate swap. |
||
|
D) all of the above |
QUESTION 9
|
A). A forward exchange agreement between currencies states the rate of exchange at which a foreign currency will be bought forward or sold forward at a specific date in the future. |
||
|
B). The spot and forward exchange rates are constantly in the state of equilibrium described by interest rate parity. |
||
|
C). The degree to which the prices of imported and exported goods change as a result of exchange rate changes is termed pass-through. |
||
|
D). If the identical product or service can be sold in two different markets; and no restrictions exist on the sale; and transportation costs of moving the product between markets are equal, then the products price should be the same in both markets. This is called the law of one price. |
In: Finance
(a) A sample of 12 of bags of Calbie Chips were weighed (to the nearest gram), and listed here as follows. [9 marks]
219, 226, 217, 224, 223, 216, 221, 228, 215, 229, 225, 229
Find a 95% confidence interval for the mean mass of bags of Calbie Chips.
(b) Professor GeniusAtCalculus has two lecture sections (A and B) of the same 4th year Advanced Calculus (AMA 4301) course in Semester 2. She wants to investigate whether section A students maybe ”smarter” than section B students by comparing their performances in the midterm test. A random sample of 12 students were taken from section A, with mean midterm test score of 78.8 and standard deviation 8.5; and a random sample of 9 students were taken from section B, with mean midterm test score of 86 and standard deviation 9.3. Assume the population standard deviations of midterm test scores for both sections are the same. Construct the 90% confidence interval for the difference in midterm test scores of the two sections. Based on the sample midterm test scores from the two sections, can Professor GeniusAtCalculus conclude that there is any evidence that one section of students are ”smarter” than the other section? Justify your conclusions. [8 marks]
(c) The COVID-19 (coronavirus) mortality rate of a country is defined as the ratio of the number of deaths due to COVID-19 divided by the number of (confirmed) cases of COVID-19 in that country. Suppose we want to investigate if there is any difference between the COVID-19 mortality rate in the US and the UK. On April 18, 2020, out of a sample of 671,493 cases of COVID-19 in the US, there was 33,288 deaths; and out of a sample of 109,754 cases of COVID-19 in the UK, there was 14,606 deaths. What is the 92% confidence interval in the true difference in the mortality rates between the two countries? What can you conclude about the difference in the mortality rates between the US and the UK? Justify your conclusions. [8 marks]
In: Statistics and Probability
Purchase-Related Transactions Using Perpetual Inventory System
The following selected transactions were completed by Capers Company during October of the current year:
| Oct. 1. | Purchased merchandise from UK Imports Co., $13,891, terms FOB destination, n/30. |
| 3. | Purchased merchandise from Hoagie Co., $9,600, terms FOB shipping point, 2/10, n/eom. Prepaid freight of $200 was added to the invoice. |
| 4. | Purchased merchandise from Taco Co., $12,350, terms FOB destination, 2/10, n/30. |
| 6. | Issued debit memo to Taco Co. for $4,950 of merchandise returned from purchase on October 4. |
| 13. | Paid Hoagie Co. for invoice of October 3. |
| 14. | Paid Taco Co. for invoice of October 4, less debit memo of October 6 and discount. |
| 19. | Purchased merchandise from Veggie Co., $29,480, terms FOB shipping point, n/eom. |
| 19. | Paid freight of $425 on October 19 purchase from Veggie Co. |
| 20. | Purchased merchandise from Caesar Salad Co., $21,200, terms FOB destination, 1/10, n/30. |
| 30. | Paid Caesar Salad Co. for invoice of October 20. |
| 31. | Paid UK Imports Co. for invoice of October 1. |
| 31. | Paid Veggie Co. for invoice of October 19. |
Required:
Journalize the entries to record the transactions of Capers Company for October.
For a compound transaction, if an amount box does not require an entry, leave it blank.
| Oct. 1 | Inventory | ||
| Accounts Payable-UK Imports Co. | |||
| Oct. 3 | Inventory | ||
| Accounts Payable-Hoagie Co. | |||
| Oct. 4 | Inventory | ||
| Accounts Payable-Taco Co. | |||
| Oct. 6 | Accounts Payable-Taco Co. | ||
| Inventory | |||
| Oct. 13 | Accounts Payable-Hoagie Co. | ||
| Cash | |||
| Oct. 14 | |||
| Oct. 19 | |||
| Oct. 19 | |||
| Oct. 20 | |||
| Oct. 30 | |||
| Oct. 31 | |||
| Oct. 31 | |||
In: Accounting
The supplementary document/resource titled “SOX Act 101-Key Components”, references eight key implementation components of the SOX Act. Given what you know about why the Act was established in 2002, explain which of those eight sections you feel was most necessary in the effort to discourage fraudulent activities by organizations. Additionally, explain which is your favorite section.
In: Accounting
The Sarbanes-Oxley Act (SOX) was passed in 2002. The legislation was intended to prevent accounting fraud. What did offending companies do to cause legislators to get involved in the situation? What safeguards were put in place by SOX? In your opinion, will SOX prevent accounting fraud? Why or why not? In your opinion, should legislators put further safeguards in place? Why or why not?
In: Accounting
On June 4, 2002, Fred bought stock at a cost of $8,000. On January 30, 2019, he gave the stock to his son, George. At the time of the gift, the fair market value of the stock was $6,500. On May 1, 2019, George sold the stock.
State whether there is a short-term or long-term capital gain or loss, and the amount of the gain or loss, if the stock was sold at $7,000.
In: Accounting
The function
D(t) = 43.1224(1.0475)^t. gives the number of master’s degrees, in
thousands, conferred on women in the United States t years after
1960. Find the number of master’s degrees earned by women in 1984,
in 2002, and in 2010. Then estimate the number of master’s degrees
that will be earned by women in 2020.?When will the number of
master’s degrees earned by women in the U.S. reach a million?
In: Math
In what major ERP module would budgeting be handled?
(2pts)
Controlling and profitability analysis module
Sales and distribution module
Financial accounting module
Supplier relationship managment module
All of the above
None of the above
66)
Most directly, characters comprise _____.
(2pts)
tables
attributes
tuples
records
None of the above
67)
Which of the following controls restrict access to programs, data, and documentation?
(2pts)
program change controls
library controls
authentication controls
password controls
All of the above
None of the above
68)
Which category of management objectives within the ERM framework addresses the efficient and effective use of resources?
(2pts)
reporting
operations
compliance
strategic
All of the above
None of the above
69)
The need to ensure that an organization's accounting information system is able to produce financial data in a timely and accurate manner relates most directly to the mandate of _____.
(2pts)
Section 409 of the Sarbanes-Oxley Act of 2002
Section 404 of the Sarbanes-Oxley Act of 2002
Internal Revenue Code of 1986
The Securities and Exchange Act of 1934
In: Finance
Assume that you will buy stock on margin (i.e.; stock margin trading). Assume that Texas Instruments Corp stock is currently selling for $50 per share. Assume that you will purchase 500 shares on July 29, 2002 at 11:00 AM. You have $15,000 of your own to invest and you will borrow an additional $10,000 from your broker at an interest rate of 10% per year. Assume that the Maintenance Margin is 40%.
17) Which of the following presents the balance sheet if the stock price increases to $100 per share July 29, 2002 at 11:01 AM. In other words, which of the following presents the balance sheet using this information.
a. ASSETS LIAB & OWN EQUITY
Stock $50,000 Liab $10,000
Equity $40,000
b. ASSETS LIAB & OWN EQUITY
Stock $25,000 Liab $10,000
Equity $15,000
c. ASSETS LIAB & OWN EQUITY
Stock $50,000 Liab $11,000
Equity $39,000
d. ASSETS LIAB & OWN EQUITY
Stock $50,000 Liab $20,000
Equity $ 30,000
e. none of the above
In: Accounting