Question: I need help in creating a simple code for the following... Prompt: Using the free program language of Coral, please use for The Spaceship Race
I need help in creating a simple code for the following...
Prompt:
Using the free program language of Coral, please use for The Spaceship Race game with the beginning of the Coral program template that starts by picture provided so you can see what I am explaining:
Declare variables here
Uncomment the line below when implementing your program code
SeedRandomNumbers
type The Spaceship Race game code here
Specifically, address the following rubric criteria:
Determine the variables and relevant data types of each variable. Consider the necessary variables required to implement the logic of The Spaceship Race game, as well as the relevant data type eg integer or float of each variable. Consider your inputs and outputs for the program as you work.
Initialize the variables using appropriate data values. Where necessary, assign an initial value to each variable. Note that variables that obtain an initial value from user input do not require initializing. For example, before you start simulating any of the games, there should be zero wins and losses.
Set a branch that uses conditionals to define the logic of the game. This must meet the requirements of the program. This includes using the following:
IF
IFELSE
IFELSEIF
Statements must also use the appropriate relational operators, which are as follows:
equals
not equal
less than
greater than
less than or equal
greater than or equal
Create one loop to define the logic, flow, and sequence of the game. This must meet the requirements of the program. Use a WHILE or FOR loop and the appropriate relational operators and Avoid infinite loops by ensuring the loop has an exit condition using the appropriate relational operator.
Spaceship Race: Write code that will apply a boost value to one spaceship in the race toward the distant star.
Apply necessary arithmetic operations. Note that mathematical operators include and modulo This must meet the requirements of the program. For example, in each of the games, you will want to keep track of wins and losses.
Spaceship Race: Keep track of the distance traveled in the first round.
"The Spaceship Race game: There are two spaceships racing across the galaxies toward a distant star. The spaceships make progress by getting a "boost," or a value between and The first spaceship to reach the distant star wins. The distance of the star the spaceships are racing toward is provided as input by the user a value between and The boost value is determined from the computer generating a random number between and The object is to have the spaceships race, and then as soon as one spaceship reaches the destination, which spaceship won or if there was a tie is provided as output."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
