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]
3 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]3 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
An adiabatic air compressor compresses 10 L/s of air at 120 kPa and 20 degree C to 1000 kPa and 300 degree C.
Oksana_A [137]

Answer:

work=281.4KJ/kg

Power=4Kw

Explanation:

Hi!

To solve follow the steps below!

1. Find the density of the air at the entrance using the equation for ideal gases

density=\frac{P}{RT}

where

P=pressure=120kPa

T=20C=293k

R= 0.287 kJ/(kg*K)= gas constant ideal for air

density=\frac{120}{(0.287)(293)}=1.43kg/m^3

2.find the mass flow by finding the product between the flow rate and the density

m=(density)(flow rate)

flow rate=10L/s=0.01m^3/s

m=(1.43kg/m^3)(0.01m^3/s)=0.0143kg/s

3. Please use the equation the first law of thermodynamics that states that the energy that enters is the same as the one that must come out, we infer the following equation, note = remember that power is the product of work and mass flow

Work

w=Cp(T1-T2)

Where

Cp= specific heat for air=1.005KJ/kgK

w=work

T1=inlet temperature=20C

T2=outlet temperature=300C

w=1.005(300-20)=281.4KJ/kg

Power

W=mw

W=(0.0143)(281.4KJ/kg)=4Kw

5 0
3 years ago
1.
Levart [38]

Answer:

This is a for loop.

Explanation:

6 0
3 years ago
Technician A says that reinforcements may be made of plastic,
lord [1]

Answer:

A Only

Explanation:

Reinforcements, as the name suggests, are used to enhance the mechanical properties of a plastic. Finely divided silica, carbon black, talc, mica, and calcium carbonate, as well as short fibres of a variety of materials, can be incorporated as particulate fillers.

3 0
3 years ago
Polymers can be natural or synthetic. a)-True b)- false?
Olenka [21]

Answer:

TRUE

Explanation:

Polymers can be natural as well as synthetic

The polymer which are found in nature are called natural polymer tease polymer are not synthesized, they are found in nature

Example of natural polymers is cellulose, proteins etc

On the other hand synthetic polymers are not found in nature they are synthesized in market

There are many example of synthetic polymer

Example : nylon, Teflon etc  

So it is a true statement

8 0
4 years ago
Does anybody want 20 points? They're free get 'em while ya can...
DedPeter [7]

Answer:

hi

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • 25 points!!
    13·1 answer
  • Determine the minimum radius of a horizontal circular curve for a route having a 70 mph design speed, super-elevation (e) 3%, an
    8·1 answer
  • The Acme threading tool forms an inc luded angle of how many degrees? A. 30 B. 55 C. 29 D. 60
    10·1 answer
  • In your new role at Wayne Industries, you have been given the freedom to propose and develop your own project ideas. You have an
    14·1 answer
  • Complete swap_bits function which swaps bits at odd and even positions of an integer (32 bits). In other words, every even posit
    15·1 answer
  • Design a solid steel shaft to transmit 14 hp at a speed of 2400rpm f the allowable shearing stress is given as 3.5 ksi.
    10·1 answer
  • Which type of muscle tissue is both voluntary and striated?
    7·2 answers
  • Which of the following approaches to lean engineering consists of teams of people from different departments sharing
    9·1 answer
  • Who do you contact to get your credit report?
    13·1 answer
  • Which type of work is a textile engineer most likely to do?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!