Question: use matlab or octave to code. do not use if statements, for loops, while loops or functions 4. (Double Coin Game) Imagine a game where

use matlab or octave to code. do not use if statements, for loops, while loops or functions
4. (Double Coin Game) Imagine a game where you flip two different coins and win points based on the combinations heads and tails. Suppose that: (a) you win no points if both coins are tails, (b) 1 point if the first coin is heads while the second is tails, (c) 10 points if the first coin is tails while the second is heads, (d) 100 points if both coins are heads. For the purposes of coding this question, each coin flip will be represented by a random integer where 0 is tails and 1 is heads which must be produced using appropriate randi commands. coin_flips.m Script: Input variables: . none Output variables: coin1 and coin2 which hold the randomly generated coin flips winnings which holds the winnings . A sample case is: >> coin flips coin1 = 1 coin2 = 1 winnings = 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
