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
aivan3 [116]
4 years ago
9

Write a static method called quadrant that takes as parameters a pair of real numbers representing an (x, y) point and that retu

rns the quadrant number for that point. Recall that quadrants are numbered as integers from 1 to 4 with the upper-right quadrant numbered 1 and the subsequent quadrants numbered in a counter-clockwise fashion:
Engineering
1 answer:
svetlana [45]4 years ago
7 0

Full Question

Write a static method called quadrant that takes as parameters a pair of real numbers representing an (x, y) point and that returns the quadrant number for that point.

Recall that quadrants are numbered as integers from 1 to 4 with the upper-right quadrant numbered 1 and the subsequent quadrants numbered in a counter-clockwise fashion. Notice that the quadrant is determined by whether the x and y coordinates are positive or negative numbers. If a point falls on the x-axis or the y-axis, then the method should return 0.

Answer

public int quadrant(double x, double y) // Line 1

{

if(x > 0 && y > 0){ //Line 2

return 1;

}

if(x < 0 && y > 0){ // Line 3

return 2;

}

if(x < 0 && y < 0) {// Line 4

return 3;

}

if(x > 0 && y < 0) {// Line 5

return 4;

}

return 0;

}

Explanation:

Line 1 defines the static method.

The method is named quadrant and its of type integer.

Along with the method definition, two variables x and y of type double are also declared

Line 2 checks if x and y are greater than 0.

If yes then the program returns 1

Line 3 checks if x is less than 0 and y is greater than 0

If yes then the program returns 2

Line 4 checks if x and y are less than 0

If yes then the program returns 3

Line 5 checks is x is greater than 0 and y is less than 0

If yes then the program returns 4

You might be interested in
PLZZ HELP ILL GIVE BRAINLYEST PLZZ HELP
Roman55 [17]
Whatever ur designing has to fit the requirements.
7 0
3 years ago
Read 2 more answers
A major tennis manufacturer is undertaking a test program for shoes, tennis balls, and tennis strings. Develop a test plan for t
serious [3.7K]

Answer:

4 balls

Explanation:

First, we find out how many tennis balls are there altogether.

There are 8 cans and each can has 3 tennis balls.

Total numberThese balls are shared with 6 players. So we divide the total quantity by 6 to find out how many tennis balls each player gets.

Each player = 24 ÷ 6 = 4

of balls = 8 x 3 = 24

8 0
3 years ago
What objects have openings that allow liquids to pass through them.
Margaret [11]

Answer:water bottles faucets tubes showers waterfalls.

Explanation:

4 0
3 years ago
Read 2 more answers
Select the statement that is false.
ra1l [238]

Answer:

D

Explanation:

the way vertices are connected may be different so having same number of edges do not mean that total degree will also be same.

8 0
3 years ago
What is the work required to deflect a linear spring (k=32 kN/m) by 120 cm?
Anit [1.1K]

Answer:

the work done by the linear spring will be equal to 23.04 k J

Explanation:

given,

k = 32 k N /m

deflected spring = 120 cm

                            = 1.2 m

work done by spring can be calculate as

                          = \dfrac{1}{2}kx^2

                          = \dfrac{1}{2}\times 32 \times 1.2^2

                          = 23.04 k J

hence, the work done by the linear spring will be equal to 23.04 k J

6 0
3 years ago
Other questions:
  • where x is the coordinate spanning the slot opening, L = 114 mm is the slot width, and U = 0.8 m/s is the peak velocity. The hei
    6·1 answer
  • 9) A construction company employs 2 sales engineers. Engineer 1 does the work in estimating cost for 70% of jobs bid by the comp
    11·1 answer
  • A stress researcher wants to look at the effect of meditation on anxiety. To do this, she creates two groups of subjects: one gr
    13·1 answer
  • A single-threaded power screw is 35 mm in diameter with a pitch of 5 mm. A vertical load on the screw reaches a maximum of 5 kN.
    13·1 answer
  • A closed rigid tank contains water initially at 10,000 kPa and 520ºC and is cooled to a final temperature of 270° C. Determine t
    9·1 answer
  • Which of the following are the main psychological domains?
    7·1 answer
  • The steam requirements of a manufacturing facility are being met by a boiler whose rated heat input is 5.5 x 3^106 Btu/h. The co
    8·1 answer
  • When Hailey participated in a tree plantation drive, she wore her most comfortable loungewear. However, the same attire was not
    11·1 answer
  • 5. After a long period of pumping from an unconfined aquifer at a constant rate of 850 m3/day, the cone of depression reaches eq
    11·1 answer
  • Ur are mean bryce lolololololololollolollolololol
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!