Startford University Using RAPTOR Solve Computer Programming Question

Question Description

Raptor Flowchart

Phase II Design step 2 (Lesson 4) Flowchart

In this phase of the project, you will implement the solution in Raptor. This will involve sequencing, selection, and iteration. Remember, Your game should allow the user to play five full rounds if they have money in their bank. Each round, the user needs to be prompted to enter a bet amount and a choice of color. The actual winning color logic is provided below. You will need to figure out where this goes in your code.

After a winning color is determined, Your output should include the winning color, if the user won or lost, the user’s updated bank and the round number.

How do I determine what the winning color was for each round?
Raptor: Raptor comes with a function called random.
random takes no arguments. The function returns a random number in the range [0.0,1.0). That is, it may sometimes return 0.0 but will never return 1.0. To generate a random integer from 1 to n, use floor((random*n) + 1). For example, you can simulate the roll of a die (random number from 1 to 6) with floor((random * 6) + 1).
A flip of the coin would be represented by 0 or 1. 0 could be heads and 1 could be tails:
if random<.5
In this scenario (red or black), we will use a flip of a coin to determine that outcome.

Prof. Angela


Calculate Price

Price (USD)
Need Help? Reach us here via Whatsapp.