Respuesta :
Answer:
See Explanation Below
Step-by-step explanation:
Given that radius = 10 and variables x and y store the x- and y-coordinate of the dart.
The expression written in Python Programming Language is as follows.
import math
# Initialise radius to 10
radius = 10
# Accept integer input for x and y
x = int(raw_input("x co-ordinate: "))
y = int(raw_input("y co-ordinate: "))
# Calculate distance
distance = math.sqrt(x*x + y*y)
# Print distance
print(distance)
# Compare distance to radius
if dist<radius:
print("Hit")
else:
print("Miss")
# End of program
Answer:
Refer below for the explanation.
Step-by-step explanation:
//math importing
import math
//initializing radius 10 as per in the question
r= 10
//input for x coordinate
A= int(raw_input("Enter number:"))
//input for y coordinate
B= int(raw_input("Enter number:"))
Distance = math.sqrt(a*a+ b*b)
print Distance
if Distance
print "gain"
else:
print "lost"