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
hichkok12 [17]
3 years ago
12

Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (

0, 0) with width 10 and height 5.  For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle.

Computers and Technology
1 answer:
Serga [27]3 years ago
5 0

Answer:

## http://pastebin.com/nQWtHb3B

#use above link for formatted program #Python3

c=[float(cord) for cord in input('Enter a point with 2 coordinate :').split(' ')]

base=[0,0]

w=10

h=5

if((abs(c[0]-base[0])<= float(w)/2) and (abs(c[1]-base[1])<= float(h)/2)):

print('Point (',c[0],', ',c[1],') is in the rectange')

else:

print('Point (',c[0],', ',c[1],') is not in the rectange')

You might be interested in
When workers use techology to work from home or an office center, they are
dem82 [27]

Answer:

Electronically

Explanation:

Hope this helps

8 0
3 years ago
Read 2 more answers
Which of the following factors will have the greatest impact on your credit score?1. Length of credit history 11. Payment histor
irinina [24]
I believe your payment history would have the greatest impact on your credit score
4 0
4 years ago
Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
yawa3891 [41]

Answer:

void print_popcorn_time(int bag_ounces){

   if(bag_ounces < 3){

       cout<<"Too small"<<endl;

   }else if(bag_ounces > 10){

       cout<<"Too large"<<endl;

   }else{

       cout<<(6 * bag_ounces)<<"seconds"<<endl;

   }

}

Explanation:

The function is the block of the statement which performs the special task.

For checking the condition in the program, the if-else statement is used.

It can check the condition one or two but if we want to check the more than two different conditions then the continuous if-else statement is used.

syntax of continuous if else:

if(condition){

statement;

}else if(condition)

statement;

}else{

statement;

}

In the question, there are three conditions;

1. bag_ounces is less than 3

2. bag_ounces greater than 10

3. else part.

we put the condition in the above if-else statement and print the corresponding message.

8 0
3 years ago
Read 2 more answers
​ The _____ attribute tells a browser to parse the HTML and JavaScript code together, only pausing to process the script before
slava [35]

Answer:

"async" attribute

Explanation:

the async attribute is used on the html script tag, it is a Boolean attribute indicating that the browser should, if possible, load the script asynchronously and then parse it as soon as it’s downloaded.

7 0
4 years ago
suppose as a head software engineer you assign the job of creating a class to a subordinate. You want to specify thirty-eight di
Goryan [66]

Answer:

jskjsjsjsjskdmsnjsnsnsns

8 0
3 years ago
Other questions:
  • How to Ctrl + shift + F4 but in a HP laptop?​
    8·2 answers
  • 7. While an adjacency matrix is typically easier to code than an adjacency list, it is not always a better solution. Explain whe
    5·1 answer
  • For example, sumDigits(234) returns 9 (= 2 + 3 + 4). (Hint: Use the % operator to extract digits and the / operator to remove th
    15·1 answer
  • Which option allows you to add different effects for each of the bulleted items on your slide
    13·1 answer
  • Adjusting the ______ adjusts the difference in appearance between light and dark areas of the photo.​
    10·2 answers
  • Prompt the user for a character and the height of a right triangle. Then, print a triangle of that height using the character en
    11·1 answer
  • Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is neede
    14·1 answer
  • Which formatting option(s) can be set for Conditional Formatting rules?
    8·2 answers
  • Question # 4
    5·1 answer
  • Which design monument beginning with A inspired the chrysler building in New York​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!