Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
454 views
in Computer by (51.9k points)
closed by

A dartboard of radius 10 units and the wall it is hanging on are represented using a two-dimensional coordinate system, with the board’s centre at coordinate (0,0). Variables x and y store the x-coordinate and the y-coordinate of a dart that hits the dartboard. Write a Python expression using variables x and y that evaluates to True if the dart hits (is within) the dartboard, and then evaluate the expression for these dart coordinates:

a) (0,0)
b) (10,10)
c) (6, 6)
d) (7,8)

1 Answer

+1 vote
by (49.6k points)
selected by
 
Best answer

The distance formula can be used to calculate the distance between the points where the dart hits the dartboard and the centre of the dartboard.

The distance of a point P(x, y) from the origin is given by \(\sqrt{x^2+y^2}\)

To calculate the square root, the equation can be raised to the power 0.5.

Program:

x = int(input('Enter X Coordinate: '))

y = int(input('Enter Y Coordinate: '))

dis = (x ** 2 + y ** 2) ** 0.5

#if dis is greater than 10, means that dart is more than 10 units away from the centre.

print(dis <= 10)

The output for the dart coordinates are as follows:

a) (0,0): True
b) (10,10): False
c) (6,6): True
d) (7,8): False

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...