0% found this document useful (0 votes)
72 views6 pages

Calculator Write-Up Pseudo Code-Prgmmmfinal

This document contains pseudo code and instructions for a calculator program that simulates a game of craps. The program uses menus, random number generation, and conditional logic to allow the user to play multiple rounds of craps, providing directions or not. It calculates the probability of various outcomes occurring and determines a fair price of $0.24 to bet based on the chance of winning $3 on the first roll, $2 on the second, or $1 on the third. The user manual explains that the game is easy to play and the goal is to roll dice that add up to 7 or 11 to win prizes of up to $4 total by hitting enter at prompts.

Uploaded by

api-318120219
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views6 pages

Calculator Write-Up Pseudo Code-Prgmmmfinal

This document contains pseudo code and instructions for a calculator program that simulates a game of craps. The program uses menus, random number generation, and conditional logic to allow the user to play multiple rounds of craps, providing directions or not. It calculates the probability of various outcomes occurring and determines a fair price of $0.24 to bet based on the chance of winning $3 on the first roll, $2 on the second, or $1 on the third. The user manual explains that the game is easy to play and the goal is to roll dice that add up to 7 or 11 to win prizes of up to $4 total by hitting enter at prompts.

Uploaded by

api-318120219
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Calculator Write-up

Pseudo codeprgmMMFINAL:
prgmMMBEGIN
prgmMMTITLE

prgmMMBEGIN:
ClrHome
For(X,1,16)
Output(4,X,"Maura's Games
For(Y,1,150)
End
ClrHome
End

prgmMMTITLE:
Menu("Let's play Craps!","with directions",M,"no directions",N,"quit",O)
Lbl M
prgmMMCRAPS
Stop
Lbl N
prgmMMCRAP2
Lbl O
ClrHome

prgmMMCRAPS:
ClrHome
Disp "If you bet 24"
Disp "cents you can"
Disp "win $3!"
Disp "enter to cont."
Pause
ClrHome
Disp "You just have"
Disp "to win on your"
Disp "first roll!"
Disp "enter to cont."
Pause
ClrHome
Disp "If you win on"
Disp "your second roll"
Disp "you win $2!"
Disp "enter to cont."

Pause
ClrHome
Disp "Or if you"
Disp "win on your"
Disp "third roll you"
Disp "can win $1!"
Disp "enter to play!"
Pause
ClrHome
Disp "Lets Play Craps!"
Disp "enter to cont."
Pause
ClrHome
Disp "In Craps you"
Disp "roll 2 dice."
Disp "enter to cont."
Pause
ClrHome
Disp "Your goal is to"
Disp "have your dice"
Disp "add to 71"
Disp "enter to cont."
Pause
ClrHome
prgmMMCRAP2

prgmMMCRAP2:
ClrHome
Disp "Start Rolling!"
Disp "enter to cont."
Pause
ClrHome
Disp "You rolled a:"
randInt(1,6)A
Disp A
Disp "enter to cont."
Pause
Disp "And a:"
randInt(1,6)B
Disp B
Disp "enter to cont."
Pause
Disp "Your total is:"
A+BC

Disp C
If 11=C or 7=C
Then
Disp "You win $3!"
Disp "enter to cont."
Pause
prgmMMPLAYCR
Else
If 11C7
Then
Disp "enter to cont."
Pause
prgmMMCRAPDI
End

prgmMMPLAYCR:
Menu("Play Again?","yes",P,"no",Q)
Lbl P
prgmMMTITLE
Stop
Lbl Q
ClrHome

prgmMMCRAPDI:
ClrHome
Disp "Let's try again!"
Disp "You rolled a:"
randInt(1,6)A
Disp A
Disp "enter to cont."
Pause
Disp "And a:"
randInt(1,6)B
Disp B
Disp "enter to cont."
Pause
Disp "Your total is:"
A+BC
Disp C
If 11=C or 7=C
Then
Disp "You win $2!"
Disp "enter to cont."
Pause

prgmMMPLAYCR
Else
If 11C7
Then
Disp "enter to cont."
Pause
prgmMMCRAP3

prgmMMCRAP3:
ClrHome
Disp "Let's try again!"
Disp "enter to cont."
Pause
Disp "You rolled a:"
randInt(1,6)A
Disp A
Disp "enter to cont."
Pause
Disp "And a:"
randInt(1,6)B
Disp B
Disp "enter to cont."
Pause
Disp "Your total is:"
A+BC
Disp C
If 11=C or 7=C
Then
Disp "You win $1!"
Disp "enter to cont."
Pause
prgmMMPLAYCR
Else
If 11C7
Then
Disp "You lose:("
Disp "enter to cont."
Pause
prgmMMPLAYCR
End

Flow Chart:

Probability math:
outcomes

value

number of ways

price

win on 1st try

$3

$24

win on 2nd try

$2

224

$448

win on 3rd try

$1

6272

$6272

lose

$0

21952

$0

Fair price:
$24+$448+$6272=$6744
8+224+6272+21952=28456
$6744/28456=$0.24

User Manual for Craps:


The game of Craps is very easy! When you bet a fair price of 24 cents, you can win up to $4.
The game starts off with a menu where you can choose to play the game with or without
directions, there is also a quit option if you decide not to play.

From there you just have to hit enter whenever enter to cont. shows on the screen.

When you are done playing another menu with show up asking if you would like to play again or
not.

You might also like