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
Mars2501 [29]
3 years ago
13

Write a program to ask for a Cartesian coordinate x,y. Your program should read in an x value and a y value and then inform the

user whether it is the origin (0,0), on the y axis, eg (0, 10), on the x axis, eg (-3,0) or in which quadrant it appears.
Computers and Technology
1 answer:
AnnZ [28]3 years ago
6 0

Answer:

The program in Python is as follows:

x = int(input("x: "))

y = int(input("y: "))

if x == 0:

   if y == 0:        print("Origin")

   else:        print("y axis")

elif x>0:

   if y > 0:        print("First Quadrant")

   elif y < 0:        print("Fourth Quadrant")

   else:        print("x axis")

elif x < 0:

   if y > 0:        print("Second Quadrant")

   elif y < 0:        print("Third Quadrant")

   else:        print("x axis")

Explanation:

These get input for x and y

<em>x = int(input("x: "))</em>

<em>y = int(input("y: "))</em>

If x is 0

if x == 0:

<em>............ and y is 0, then the point is at origin</em>

   if y == 0:        print("Origin")

<em>............ and y is not 0, then the point is on y-axis</em>

   else:        print("y axis")

If x is greater than 0

elif x>0:

<em>............ and y is greater than 0, then the point is at in the first quadrant</em>

   if y > 0:        print("First Quadrant")

<em>............ and y is less than 0, then the point is at in the fourth quadrant</em>

   elif y < 0:        print("Fourth Quadrant")

<em>............ Otherwise, the point is on the x axis</em>

   else:        print("x axis")

If x is less than 0

elif x < 0:

<em>............ and y is greater than 0, then the point is at in the second quadrant</em>

   if y > 0:        print("Second Quadrant")

<em>............ and y is less than 0, then the point is at in the third quadrant</em>

   elif y < 0:        print("Third Quadrant")

<em>............ Otherwise, the point is on the x axis</em>

   else:        print("x axis")

You might be interested in
Assuming a 32bit processor If I have a double pointer defined as dPtr and I add 1 to it. How many bytes are added to the address
Anni [7]

Answer:

Theoretically one could design an architecture that would address 16 GB of memory with 32-bits of unique addresses.

Explanation:

4 0
2 years ago
12. Which of the following is CourseBit®? (1 point)
Annette [7]
<span>12. Which of the following is CourseBit®? 
</span><span>a leading Moodle™ development and hosting provider that focuses on highly customized systems
</span>
<span>13. In Blender®, which interface principle corresponds to the user interface that allows a user to view all options and tools at a glance with pushing or dragging editors around?
non-overlapping

Hope this helps.</span>
4 0
3 years ago
Write a program that prompts the user to enter a month (1-12) and year, then displays the number of days in the month. For examp
uysha [10]

Answer:

In Java

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

    int mnth, yr;

 Scanner input = new Scanner(System.in);

 System.out.print("Month: ");  mnth = input.nextInt();

 System.out.print("Year: ");  yr = input.nextInt();

 boolean lpYear = (yr % 4 == 0 && yr % 100 != 0) || (yr % 400 == 0);

 if(mnth == 1 || mnth == 3 || mnth == 5 || mnth== 7 || mnth == 8 || mnth == 10 || mnth == 12){

     System.out.print("31 days");  }

 else if(mnth == 2){

     System.out.print(((lpYear) ? "29 days" : "28 days"));  }

else if(mnth == 9 || mnth == 6 || mnth == 4 || mnth== 11){

     System.out.print("30 days");  }

 else{      System.out.print("Invalid");  }

}

}

Explanation:

See attachment for complete program where comments were used as explanation.

Download txt
3 0
3 years ago
HELP PLEASE!!!
CaHeK987 [17]
We could create stuff to replace plastic like straws,Six pack rings, and other stuff so pollution would go down and less plastic in the ocean
4 0
3 years ago
State the name of the following computer components​
olga2289 [7]

Answer:

Memory.

Hard Drive or Solid State Drive.

Video card.

Motherboard.

Processor.

Power Supply.

Monitor.

Keyboard and Mouse.

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • Why is it important to bring standalone systems into the domain? 4?
    8·1 answer
  • Akira has trouble reading what is on the computer screen and sometimes seeing pictures on websites. As her friend, you explain t
    8·1 answer
  • Adding functionality to a Button is easy when you use the IDE. After you have dragged a Button onto a Form, you can ____ it to c
    7·1 answer
  • Describa las características más importantes de cada procedimiento,difencias entre si Procedimiento Bessemer Procedimiento Sieme
    15·1 answer
  • Imagine you had a learning problem with an instance space of points on the plane and a target function that you knew took the fo
    11·1 answer
  • Defensive driving is when you use driving strategies to minimize risk and help avoid accidents.​
    8·1 answer
  • Why would students most likely need to collect data? Check all that apply.
    12·2 answers
  • Horizontal and vertical flips are often used to create ___.
    12·1 answer
  • The following method is intended to return true if and only if the parameter val is a multiple of 4 but is not a multiple of 100
    7·1 answer
  • Can someone help me and explain
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!