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
seraphim [82]
3 years ago
13

You are making a game! The player tries to shoot an object and can hit or miss it. The player starts with 100 points, with a hit

adding 10 points to the player’s score, and a miss deducting 20 points. Your program needs to take 4 action results as input ("hit" or "miss"), calculate and output the player’s remaining points.
Computers and Technology
1 answer:
Anni [7]3 years ago
3 0

The program illustrates the use of loops and conditions.

Loops are used for repetitions, while conditions are used to make decisions

The game program in Python, where comments are used to explain each line is as follows:

#This initializes the point to 100

point = 100

#The following loop is repeated 4 times

for i in range(4):

   #This gets the current action

   action = input("Hit or Miss: ")

   #This following if statement calculates the point

   if action.lower() == "hit":

       point+=10

   else:

       point-=20

#This prints the calculated point

print(point)

Read more about loops and conditions at:

brainly.com/question/14284157

You might be interested in
Hardware failure, power outages, and DOS attacks will affect:
const2013 [10]

Answer:

The answer should be data availability

6 0
3 years ago
Write a class called point that represents a point in 2d plane.
USPshnik [31]

In this way, writing the code in C++ we can say that it will be possible to make the coordinates on the planes.

<h3>Writing the code we have:</h3>

<em>#include <iostream></em>

<em>#include <cmath></em>

<em>#include <iomanip></em>

<em>using namespace std;</em>

<em>class Point{</em>

<em>private:</em>

<em>float x;</em>

<em>float y;</em>

<em>public:</em>

<em>Point(){ </em>

<em>x = y = 0;</em>

<em>}</em>

<em>Point(float x, float y){ </em>

<em>this->x = x;</em>

<em>this->y = y;</em>

<em>}</em>

<em>float getX(){ </em>

<em>return x;</em>

<em>}</em>

<em>float getY(){</em>

<em>return y;</em>

<em>}</em>

<em>float getDistance(){</em>

<em>return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2));</em>

<em>}</em>

<em>string toString(){ </em>

<em>return "("(x1, y)","(x2, y2)")";</em>

<em>}</em>

<em>};</em>

See more about C code at brainly.com/question/17544466

#SPJ1

7 0
2 years ago
What is the one common feature that ties together different social media technologies
Mazyrski [523]
They have the key feature of communication.
All social media encourage us to interact with others, be it with family, friends, known or unknown people.
3 0
3 years ago
Which describes the purpose of the continue statement in Java?
Anton [14]
Your answer is d skip to the next line



7 0
3 years ago
Describe como es el movimiento de un volantín
Maksim231197 [3]

Answer:

Lift is generated by differences in air pressure, which are created by air in motion over the body of the kite. Kites are shaped and angled so that the air moving over the top moves faster than the air moving over the bottom. ... Thrust is the forward force that propels a kite in the direction of motion

Explanation:

8 0
3 years ago
Other questions:
  • Pixel Data
    9·1 answer
  • You install an M.2 SSD card in an M.2 slot on a motherboard. When you boot up your system, you discover the DVD drive no longer
    15·1 answer
  • Match the software requirements of a server to their purpose
    5·1 answer
  • Most large organizations store data through a strategy called a(n) ________ to promote efficient and safe use of data across the
    11·1 answer
  • Why would you use quotation marks in a search string when conducting an internet search?
    12·1 answer
  • The freemen's bureau was the U.S.' first ____ program.​
    14·1 answer
  • Pls answer i need to turn it in today!!
    15·1 answer
  • Fill in the blank to complete the sentence. -------------------- is used to store and process data over the Internet using compu
    10·1 answer
  • READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
    7·1 answer
  • Which structures protect the cell? Select two options.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!