1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
2 years ago
12

Write a program that simulates applying a "boost" to a spaceship in a spaceship race game.

Computers and Technology
1 answer:
rewona [7]2 years ago
8 0

Programming languages can be used to simulate several scenarios; in this case, the "boost"

The simulating program in C++ where comments are used to explain each line is as follows:

#include<iostream>

#include<cstdlib>

#include<ctime>

using namespace std;

int main() {

 // This sets the seed to time(0)

 srand(time(0));

 // This generates a random number between 0 and 10, to represent the boost

 int boost = rand()%10;

 // This prints the required outputs

 cout << "Boost: " << boost;

 cout << "\nDistance travelled: " << boost;

 return 0;

}

Read more about similar programs at:

brainly.com/question/16240699

You might be interested in
Does anybody have the answer for 2.19.6 checkerboard for codehs??
ANTONII [103]

Answer:

speed(0)

penup()

setposition(-200,-200)

pendown()

def draw_square_row():

color_value = 0

for i in range (10):

if color_value %2 == 0:

begin_fill()

color("red")

for i in range (4):

forward(40)

left(90)

forward(40)

color_value = color_value + 1

end_fill()

elif color_value %2 == 1:

begin_fill()

color("black")

for i in range (4):

forward(40)

left(90)

forward(40)

color_value = color_value + 1

end_fill()

def draw_square_row_2():

color_value = 1

for i in range (10):

if color_value %2 == 0:

begin_fill()

color("red")

for i in range (4):

forward(40)

left(90)

forward(40)

color_value = color_value + 1

end_fill()

elif color_value %2 == 1:

begin_fill()

color("black")

for i in range (4):

forward(40)

left(90)

forward(40)

color_value = color_value + 1

end_fill()

def move_up_a_row():

left(90)

forward(40)

right(90)

backward(400)

for i in range (5):

draw_square_row()

move_up_a_row()

draw_square_row_2()

move_up_a_row()

Explanation:

tell me if you get it right

5 0
2 years ago
Will give brainliest!!<br> (Question 3)
Gnoma [55]

Answer:

A is the correct answer

8 0
3 years ago
Read 2 more answers
Que se encarga de notar lo que pasa alrededor
Angelina_Jolie [31]

Answer: Es nuestro cerebro. Los ojos son las estructuras capaces de transformar las señales luminosas en impulsos eléctricos, los cuales viajan al cerebro y, una vez ahí, él se encarga de transformar estas señales eléctricas en lo que vemos realmente. Y lo mismo pasa con todos los otros sentidos.

Explanation:

7 0
3 years ago
Which group on the home tab contains the line spacing attribute?
Juli2301 [7.4K]

Answer:

The Paragraph group on the Home tab contains commands to set and control several format options for a paragraph. The options include alignment, indentation, line spacing, and pagination. click Ctrl+J to justify. You can indent individual paragraphs so they appear to have different margins from the rest of a document.

Explanation:

comment an let me know how it helps

8 0
3 years ago
A cell in a spreadsheet can contain _________?
serg [7]
The correct answer is All of these :)
3 0
3 years ago
Other questions:
  • A software program that enables users to find and display information stored as html pages on the internet is a(n) ____.
    5·1 answer
  • While you are working with a document using a program such as wordpad, the document is stored in ___________?
    15·2 answers
  • .in the array based list implementation of the ADT what is the worst case time efficiency of the remove method?
    6·1 answer
  • Olivia is trying to save for a new laptop computer. To help her save, she should start a _____. database financial statement per
    7·2 answers
  • Can I use some Company's name in my Research Project. For example, my research is based on E-commerce security and i wanna use A
    14·1 answer
  • A small but growing advertising business hires a new secretary. Until now, the computers have been directly connected, and all t
    12·1 answer
  • Which of the following speeches is an example of a demonstration speech? a. “Who was Abraham Lincoln” b. “The Human Brain and it
    5·1 answer
  • Aside from human user types, there are non human user groups. Known as account types, __________ are implemented by the system t
    10·1 answer
  • .<br>1.<br>CPU<br>f. ALU<br>. CU<br>h. CRT<br>g. LED<br>​
    15·1 answer
  • With SQL, how do you select all the columns from a table named "Persons"?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!