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
Marina CMI [18]
3 years ago
5

Implement a program that requests the user to enter the x and y coordinates (each between 10 and 10) of a dart and computes whet

her the dart has hit the dartboard, a circle with center (0,0) and radius 8. If so, string It is in! should be printed on the screen.
Computers and Technology
1 answer:
igomit [66]3 years ago
4 0

Answer:

Following are the program in the Python Programming Language.

#import math package

from math import sqrt

#define function

def circle(x,y):

 #return the square root

 return sqrt( (x)**2 + (y)**2 )

#get input from the user

x = float(input("Enter first number between -10 and 10: "))

#get input from the user

y = float(input("Enter first number between -10 and 10: "))

#check condition

if(circle(x,y)<8):

 #then, print message

 print("It is in!")

#otherwise

else:

 #print message

 print("It is not in!")

<u>Output:</u>

Enter first number between -10 and 10: 1.5

Enter first number between -10 and 10: 2.6

It is in!

Explanation:

Here, in the following program in the Python Programming Language.

  • Define the function "circle" and pass the argument "x" and "y" then, return square root of x and y.
  • Set a variable "x" which get float type input from the user.
  • Set a variable "y" which get float type input from the user.
  • Set the if conditional statement to check that the function return the value less than 8 then, print the message.
  • Otherwise, it print the following message.
You might be interested in
How many responses does a computer expect to receive when it broadcasts an ARP request?why?
Alla [95]

Answer: The response that is expected when it broadcast an ARP request is one or zero.

Explanation: ARP request means Address Resolution Protocol which is a protocol responsible for the mapping of the IP(Internet protocol)address of a system to the MAC(Media Access Control) layer. Only one response is received only if the IP address is present in the ARP otherwise if the IP address does not matches then no response is returned.Thus only one or zero response can be received when a ARP request is process.

5 0
2 years ago
Enter a word: Good<br> Enter a word: morning<br> Good morning
blondinia [14]
Good Morning Everyone I-
8 0
3 years ago
Read 2 more answers
If I wanted to repeat an action such as a heading for a paper, it would be helpful to _____. create a citation create a caption
salantis [7]
Um... Copy and paste
7 0
3 years ago
Read 2 more answers
Difference between implicit and explicit type casting
Lana71 [14]

Answer:

Implicit type casting means the type casting done by the compiler during compilation of program whereas Explicit type casting means the programmer explicitly type casts the variables. This is the difference implicit and explicit type casting.

Explanation:

Type casting means the conversion of one data type into another data type. There are two types of type casting. They are Implicit type casting and Explicit type casting.

<u>Implicit type casting:</u> The type casting which is done by the compiler during the compilation of a program. This occurs when we assigning smaller data type to larger data type and also both the data type are compatible. Below example clears the above concepts.

Ex: int \, i = 10;

long \, l = i;

In the above example " i "  is " int " data type whereas  " l " is long data type but as we assigned the value of " i " to " l ". Here " int " and " long " are compatible data types and we assigned smaller data type ( int - i ) to larger data type  ( long - l ) implicit type casting occurs.

<u>Explicit type casting:</u> The type casting which is done by the programmer explicitly to convert one data type into other data type. If we want to assign a value of larger data type to smaller data type explicit type casting is required. Below example clears the above concepts.

Ex: double \, d = 10.4;

long\, l = (long) d;

In the above example " d " is " double " data type whereas " l " is " long " data type. Here we are explicitly type casting to change larger data value ( double - d ) to smaller data value ( long - l ).  

7 0
3 years ago
Read 2 more answers
How many grams are in 100 pounds?
stepan [7]

Answer:

45359.2 grams are in 100 pounds

Explanation:

Hope this helped, Have a Wonderful Day!!

3 0
2 years ago
Read 2 more answers
Other questions:
  • What is the maximum number of hosts you can have on a network if the first decimal value of the ip address is between 192 and 22
    10·1 answer
  • Which windows tool can you use to find out if the hard drive is slowing down windows performance?
    9·1 answer
  • You run an automobile selling company that has a popular online store on AWS. The application sits behind an Auto Scaling group
    6·1 answer
  • Drag each label to the correct image.
    9·2 answers
  • What are some of the ways you can use bitlocker encryption? (choose all that apply?
    10·1 answer
  • What is the full form of 'Rom<br>​
    7·2 answers
  • You have this code in your program.
    7·1 answer
  • Do you think JNK should be more ethical?
    6·1 answer
  • Assessment
    12·1 answer
  • What is the difference between information poor and information rich<br>​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!