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

1. Add the following method to the Point class:

Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
4 0

Answer:

Explanation:

The following code is written in Java and creates all of the methods that were requested in the question. There is no main method in any of these classes so they will have to be called from the main method and call one of the objects created method for the code to be tested. (I have tested it and it is working perfectly.)

class Point {

   private int x, y;

   public void Point(int x, int y) {

       this.x = x;

       this.y = y;

   }

   public double distance (Point other) {

      double distance = Math.sqrt(Math.pow((other.x - this.x), 2) + Math.pow((other.y - this.y), 2));

      return distance;

   }

   

   public int quadrant() {

       if (this.x > 0 && this.y > 0) {

           return 1;

       } else if (this.x < 0 && this.y > 0) {

           return 2;

       } else if (this.x < 0 && this.y < 0) {

           return 3;

       } else if (this.x > 0 && this.y < 0) {

           return 4;

       } else {

           return 0;

       }

   }

}

class Name {

   String firstName, lastName;

   char middleInitial;

   

   public String getNormalOrder() {

       String fullName = firstName + " " + middleInitial + " " + lastName;

       return fullName;

   }

   

   public String getReverseOrder() {

       String fullName = lastName + ", " + firstName + " " + middleInitial;

       return fullName;

   }

}

You might be interested in
Interactive sites were usually is right about important topics and comments to a threaded discussion are called
iren2701 [21]
The answer to this question is:

Interactive sites were usually is right about important topics and comments to a threaded discussion are called"Blogs"

Hoped This Helped, Euniceortiz13
Your Welcome :)
8 0
3 years ago
Program your own file lab7.cpp in which your main() function will test the new data structure. The main() function, Declares an
Stella [2.4K]
Is this a question or just something up here just to be here
3 0
3 years ago
C++ question:
gogolik [260]
There's no "using namespace std;" statement. I see no reason for COLOR to be two dimensional or have a length of 5 with only four elements. The inside of the for loop with variable 'J' makes no sense.
3 0
3 years ago
Read 2 more answers
Convert decimal number 126.375 to binary (3 bits after binary point)
nevsk [136]

Answer:

126.375 in binary is: 1111110.011

Explanation:

In order to convert a decimal number to binary number system, the integral part is converted using the division and remainder method while the fractional part is multiplied with 2 and the integral part of answer is noted down. The fractional part is again multiplied with 2 and so on.

For 126.375

2         126

2          63 - 0

2          31 - 1

2          15 - 1

2            7 - 1

2            3 - 1

              1 - 1

So, 126 = 1111110

For 0.375

0.375 * 2 = 0.75

0.75 * 2 = 1.5

0.5 * 2 = 1.0

As we had to only find 3 digits after binary point, so

0.375 = 011

So 126.375 in binary is: 1111110.011 ..

8 0
3 years ago
Cloud storage refers to the storage of data on ______.a. your mobile device.b. your desktop computer.c. an external drive.d. a s
eimsori [14]

Answer:

D.  server on the internet

Explanation:

6 0
3 years ago
Other questions:
  • The equation y=2x+1 represents a function true or false
    11·1 answer
  • A type of font that has a decorative tail is A.Serif font B. Sans serif font C. Bubbles font D. Reading font
    7·1 answer
  • what is the goal of technology A. to understand how the natural world functions B. to study the natural world C. to improve the
    9·1 answer
  • Use BlueJ to write a program that reads a sequence of data for several car objects from an input file. It stores the data in an
    5·1 answer
  • Naomi wants to search for online courses on web development she types this term in the address bar which browser allows her to u
    8·1 answer
  • Which examples are relevant sources for students to use in research?
    6·1 answer
  • A _____ is relatively inexpensive to install and is well-suited to workgroups and users who are not anchored to a specific desk
    14·1 answer
  • HLOOKUP is used for Horizontal Data look ups while VLOOKUP is for Vertical Data look ups
    8·1 answer
  • How does computer science play a role in art?
    6·1 answer
  • Education leads to higher wages lower unemployment.* True or false
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!