Question: Create a _ function called payout with three arguments _ : player _ score , ` dealer _ score and bet . Assign a default

Create a _function called payout with three arguments_: player_score ,`dealer_score and bet . Assign a default _value _ of '1' to the argument `bet '. The goal of the _function_ payout is to return the amount that the player should receive (positive number ) or pay-in (negative number ) based on the values passed to the player_score', `dealer_score and *bet" arguments The final amount should be returned as a single numeric. value. For example, if the player wins without blackjack the function should return 1\*bet; implying that the player wins 1\*bet in this round. `{r Question_6, echo=TRUE} # Complete the following code {r Question_6_test, echo=TRUE, eval=FALSE} # TEST CODE # DO NOT EDIT test_vals <- c(0,16,19,20,21,21.5) test_payout <- matrix(c(-1,1,1,1,1,1.5,-1,0,1,1,1,1.5,-1,-1,0,1,1,1.5,-1,-1,-1,0,1,1.5,-1,-1,-1,-1,0,1.5,-1,-1,-1,-1,-1,0),

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!