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
Create a function, return type: char parameters: int *, int * Inside the function, ask for two integers. Set the user responses
iris [78.8K]

Answer and Explanation:

In C programming language:

char fun(int*a, int*b){

printf("enter two integers: ");

scanf("%d%d",a,b);

int e;

printf("please enter a character: ");

e=getchar();

return e;

}

int main(int argc, char *argv[]) {

int d;

int f;

int g;

fun();

printf("%d%d%d", d, f, g);

}

We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.

4 0
3 years ago
1. Describe the sequencing of factors influencing health status codes for patients that also have chronic conditions being manag
Vesnalui [34]
Bubyggyy tvtvtvttfrcrt
4 0
3 years ago
Do you think Google has an unfair advantage as a social media marketing platform? Explain.
Bond [772]
In some aspects, yes but these have recently been outweighed with the ad boycott youtube has not to mention google plus wasn't the most popular, to begin with, but in an overall sense yes as the name google is more often used than Facebook or twitter
3 0
3 years ago
Read 2 more answers
Function Integer cube(Integer num) Return num * num * num End Function Write a main module that contains a statement that passes
Klio2033 [76]

Answer:

#include <iostream>

using namespace std;

int cube(int num)//function cube..

{

   return num*num*num;

}

int main() {

   int result=cube(4);//result stores the value of cube(4).

   cout<<result;//displaying it to the screen.

return 0;

}

Explanation:

The above code is in C++ language.The function cube is passed with value 4 and the result of it is stored in the variable result of integer type.Then the result is displayed using the cout. Which is used to print the statement to the output screen.

5 0
3 years ago
LISTEN I NEED EVERY SINGLE BRAINLY USER TO RE POST THIS THERE IS A USER WHO JUST SAID THEY ARE GOING TO KILL THEMSELVES PLEASE C
Over [174]
WHAT IS THE NAME OF THE BRAINLY USER
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which troubleshooting tool enables you to connect to a user's remote computer, view and interact with the user's screen, and cha
    8·1 answer
  • Which of the following statements is false? a. Racks and bins are examples of storage equipment. b. Automation refers to equipme
    9·1 answer
  • Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
    5·1 answer
  • Which of the following is NOT true about RMI? RMI uses the socket connection, including opening and closing the socket. RMI allo
    8·1 answer
  • Which branch of science helps avoid or minimize stress related injuries at workplace? _____ is a branch of science that aims to
    15·1 answer
  • I need 3 sentences on adware.<br> What they do and how they are a risk.
    5·1 answer
  • How do you think electronic spreadsheets have transformed businesses today?​
    6·1 answer
  • 1.6<br> What do you call the two parts of the lift that goes down a mine?
    10·1 answer
  • a computer technician performed a number of actions to correct a problem. some actions did not solve the problem, but eventually
    9·1 answer
  • 04. Suppose a computer program needs to sort a list of student records in ascending order
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!