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
The loneliest people are to kindest
valkas [14]

Answer:

The most damaged people are the wisest is a fact

Explanation:

5 0
3 years ago
Read 2 more answers
What is a business cycle? a period of economic growth followed by economic contraction the amount of time it takes a business to
Rzqust [24]

Business cycle and its growth followed by economic contraction the amount of time it takes a business to produce products in the following way.

Explanation:

The business cycle is the periodic but irregular up-and-down movement in economic activity, measured by fluctuations in real gross domestic product (GDP) and other macroeconomic variables.

A business cycle is typically characterized by four phases—recession, recovery, growth, and decline—that repeat themselves over time.

Economists note, however, that complete business cycles vary in length. The duration of business cycles can be anywhere from about two to twelve years, with most cycles averaging six years in length.

FACTORS THAT SHAPE BUSINESS CYCLES

Volatility of Investment Spending

  • Variations in investment spending is one of the important factors in business cycles. Investment spending is considered the most volatile component of the aggregate or total demand (it varies much more from year to year than the largest component of the aggregate demand, the consumption spending), and empirical studies by economists have revealed that the volatility of the investment component is an important factor in explaining business cycles in the United States.

Momentum

Technological Innovations

Variations in Inventories

Fluctuations in Government Spending

Politically Generated Business Cycles

Monetary Policies

Fluctuations in Exports and Imports

7 0
3 years ago
Read 2 more answers
Write a method printShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, prin
kirill [66]

Answer:

// The method is defined with a void return type

// It takes a parameter of integer called numCycles

// It is declared static so that it can be called from a static method

public static void printShampooInstructions(int numCycles){

// if numCycles is less than 1, it display "Too few"

   if (numCycles < 1){

       System.out.println("Too few.");

   }

// else if numCycles is less than 1, it display "Too many"

    else if (numCycles > 4){

       System.out.println("Too many.");

   }

// else it uses for loop to print the number of times to display

// Lather and rinse

  else {

       for(int i = 1; i <= numCycles; i++){

           System.out.println(i + ": Lather and rinse.");

       }

       System.out.println("Done");

       

   }

}

Explanation:

The code snippet is written in Java. The method is declared static so that it can be called from another static method. It has a return type of void. It takes an integer as parameter.

It display "Too few" if the passed integer is less than 1. Or it display "Too much" if the passed integer is more than 4. Else it uses for loop to display "Lather and rinse" based on the passed integer.

8 0
3 years ago
To become familiar with the general equations of plane strain used for determining in-plane principal strain, maximum in-plane s
lukranit [14]

Answer:

a) -1.46 x 10∧-5, 1.445x 10∧-4, -6.355 x 10∧-4

b) 3.926 x 10∧-4, -2.626 x 10∧-4

c) 6.552 x 10∧-4, 6.5 x 10∧-5

Explanation:

a) -1.46 x 10∧-5, 1.445x 10∧-4, -6.355 x 10∧-4

b) 3.926 x 10∧-4, -2.626 x 10∧-4

c) 6.552 x 10∧-4, 6.5 x 10∧-5

The explanation is shown in the attachment. I hope i have been able to help.

3 0
3 years ago
what is the method of the slope stabilization, and how many type of method of the stabilization, please help explain the types o
Alik [6]

Answer:

1.Plant Grass and Shrubs. Grass and shrubs are very effective at stopping soil erosion. ...

2.Use Erosion Control Blankets to Add 3.Vegetation to Slopes. ...

4.Build Terraces. ...

5.Create Diversions to Help Drainage

5 0
3 years ago
Other questions:
  • Water at 20 bar and 400 C enters a turbine operating at steady state and exits at 1.5 bar. Stray heat transfer and kinetic and p
    14·1 answer
  • The wheel and the attached reel have a combined weight of 50lb and a radius of gyration about their center of 6 A k in = . If pu
    9·1 answer
  • The line voltage of a balanced three-phase transmission line is 4200 V rms. The transmission line has an impedance of 4 6 Z j l
    12·1 answer
  • Dunno what to ask, okbye
    5·1 answer
  • Define the Artist class in Artist.py with a constructor to initialize an artist's information. The constructor should by default
    7·1 answer
  • NO SCAMS
    9·2 answers
  • A global resources company uses data-intensive, cloud-based simulation software, but users in remote locations find that the res
    6·1 answer
  • Most equipment is cooled by bringing cold air in the front and ducting the heat out of the back. What is the term for where the
    9·1 answer
  • A sprinter reaches his maximum speed in 2.5sec from rest with constant acceleration. He then maintains that speed and finishes t
    15·1 answer
  • which of the following processes would be appropriate for cutting a narrow slot, less than 0.015 inch wide, in a 3/8- inch thick
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!