Computing apps notes 12

Computing apps - Weather In Malibu during month of November each day has a 2 chance of rain and 80 chance of sunshine a 10 chance of fog and an 8

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Weather In Malibu during month of November, each day has a 2% chance of rain, and 80% chance of sunshine, a 10% chance of fog, and an 8% chance of smoke. *rand() generates a value betwe simulate Malibu's weather for the Month of November Day Condition 1 Sunshine 0 Rain 2 Sunshine 0.02 Sunshine 3 Sunshine 0.82 Fog 4 Sunshine 0.92 Smoke 5 Sunshine 6 Fog 7 Fog 8 Smoke 9 Sunshine 10 Sunshine 11 Sunshine
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
en 0 and 1
Background image of page 2
Slot Machine A slot machine has the following symbol: cherries, lemons, grapes, bells, sevens. 30% of the symbols are cheeries. 40% of the symbols are lemons. 20% OF THE SYMBOLS ARE GRAPES, 5% of the symbols are bells and 5% are sevens. Three of the same symbol pays $5. Three sevens pays $1000. Each spin costs $1.  Simulate the operation of this machine. Wheel 1 Wheel 2 Wheel 3 Money 0 Cherry Lemon Grapes Cherry ($1) 0.3 Lemon Cherry Cherry Lemon ($2) 0.7 Grapes Lemon Lemon Lemon ($3) 0.9 Bell Cherry Grapes Lemon $1  0.95 Seven Seven Cherry Grapes $0  Grapes Lemon Grapes ($1) Lemon Lemon Grapes ($2) Grapes Cherry Lemon ($3) Lemon Grapes Lemon ($4) Cherry Grapes Bell ($5) Seven Cherry Cherry ($6) Cherry Lemon Lemon ($7) Grapes Grapes Bell ($8) Lemon Cherry Cherry ($9) Grapes Bell Cherry ($10) Cherry Grapes Grapes ($11) Lemon Lemon Cherry ($12) Lemon Lemon Bell ($13) Lemon Grapes Lemon ($14) Cherry Cherry Lemon ($15) Cherry Cherry Lemon ($16) Lemon Lemon Lemon ($17) Lemon Grapes Lemon ($13) Grapes Grapes Grapes ($14) Lemon Grapes Lemon ($10) Lemon Seven Grapes ($11) Seven Grapes Lemon ($12) Lemon Cherry Grapes ($13) Cherry Seven Cherry ($14) Lemon Lemon Lemon ($15) Lemon Cherry Lemon ($11) Cherry Grapes Cherry ($12) Grapes Lemon Lemon ($13) Lemon Grapes Lemon ($14)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lemon Lemon Cherry ($15) Lemon Lemon Lemon ($16) Cherry Cherry Lemon ($12) Cherry Lemon Grapes ($13) Cherry Cherry Seven ($14) Grapes Lemon Lemon ($15) Seven Grapes Seven ($16) Grapes Lemon Cherry ($17) Cherry Lemon Grapes ($18) Grapes Cherry Lemon ($19) Lemon Lemon Grapes ($20) Grapes Lemon Cherry ($21) Bell Cherry Lemon ($22) Lemon Lemon Grapes ($23) Lemon Lemon Cherry ($24) Cherry Lemon Grapes ($25) Seven Grapes Grapes ($26) Lemon Grapes Lemon ($27) Bell Grapes Lemon ($28) Cherry Lemon Lemon ($29) Grapes Cherry Cherry ($30) Lemon Seven Grapes ($31) Lemon Cherry Grapes ($32) Cherry Lemon Cherry ($33) Lemon Lemon Grapes ($34) Grapes Lemon Bell ($35) Lemon Lemon Bell ($36) Lemon Cherry Cherry ($37) Lemon Grapes Cherry ($38) Cherry Lemon Cherry ($39) Cherry Cherry Seven ($40) Cherry Cherry Lemon ($41) Lemon Bell Grapes ($42) Seven Grapes Bell ($43) Lemon Grapes Lemon ($44) Grapes Lemon Cherry ($45) Cherry Lemon Seven ($46) Lemon Lemon Lemon ($47) Cherry Grapes Grapes ($43) Lemon Seven Grapes ($44) Lemon Cherry Seven ($45) Lemon Cherry Cherry ($46) Lemon Lemon Lemon ($47) Lemon Lemon Lemon ($43) Cherry Lemon Grapes ($39)
Background image of page 4
Bell Grapes Lemon ($40) Lemon Cherry Lemon ($41) Cherry Seven Bell
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/27/2009 for the course BA 212 taught by Professor Bradcupp during the Spring '09 term at Pepperdine.

Page1 / 28

Computing apps - Weather In Malibu during month of November each day has a 2 chance of rain and 80 chance of sunshine a 10 chance of fog and an 8

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online