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
Inga [223]
3 years ago
9

Homework Assignment 2 1. Consider the skeletal definition for a class called circle given as: public class Circle { private int

radius; private Location location; private String = name; … } Override the equals and hashCode methods of the Object class for the Circle class. Assume that two circles are considered to be equal if they have the same radius and location (i.e. name field does not matter). Further assume that the Location class has overridden the hashCode method of the Object class. 2. Answer questions 12.35, 12.36, and 12.37 in the BlueJ text. 3. For the Date class provided with this assignment (Note: this is a BlueJ project) , implement the Comparable interface for the Date class. A date is considered less than another date if it comes before it in time.
Computers and Technology
1 answer:
jek_recluse [69]3 years ago
3 0

Answer:

See explaination

Explanation:

public class Circle {

private double radius;

private Location location;

private String name;

/* (non-Javadoc)

* atsee java.lang.Object#hashCode()

*/

atOverride

public int hashCode() {

final int prime = 31;

int result = 1;

result = prime * result + ((location == null) ? 0 : location.hashCode());

long temp;

temp = Double.doubleToLongBits(radius);

result = prime * result + (int) (temp ^ (temp >>> 32));

return result;

}

/* (non-Javadoc)

* atsee java.lang.Object#equals(java.lang.Object)

*/

atOverride

public boolean equals(Object obj) {

if (this == obj)

return true;

if (obj == null)

return false;

if (getClass() != obj.getClass())

return false;

Circle other = (Circle) obj;

if (location == null) {

if (other.location != null)

return false;

} else if (!location.equals(other.location))

return false;

if (Double.doubleToLongBits(radius) != Double.doubleToLongBits(other.radius))

return false;

return true;

}

NOTE: Replace all the "at" within the program with the at symbol ie shift 2.

You might be interested in
An objective test or measurement that technology product evaluators use to compare two or more products is ____.
Crazy boy [7]
<span>An objective test or measurement that technology product evaluators use to compare two or more products is benchmark. The benchmark is set of standards which are used to compare two products. Several parameters are measured in order to compare the products and to define the weak points where improvements can be done. The obtained information form the test is used to improve performance. </span>
4 0
3 years ago
"During the _____ of the systems development life cycle (SDLC), an information system is operating, enhancements and modificatio
zheka24 [161]

Answer:

Maintenance Phase

Explanation:

Maintenance Phase -

It refers to the phase in the system development life cycle , where alterations are done in the documentation , software and hardware in order to support the operational effectiveness , is referred to as the maintenance phase .

The phase requires , correct problems , increase security etc.

Hence , from the given information of the question ,

The correct answer is maintenance phase .

6 0
3 years ago
The Thing method printMessage prints a string consisting of the name of the object followed by "_is_great". Suppose the name of
Harman [31]

Answer:

Written in C++

The statement that prints the required output is:

<em>printMessage(favFood); </em>

Explanation:

The full program is with comment is:

#include<iostream>

using namespace std;

//The method begins here

void printMessage(string favFood){

//This line prints the required output

cout<<favFood<<"_is_great";

}

//The main method starts here

int main()

{

//This line declares favFood as string

string favFood;

//This line prompts user for input

cout<<"Food: ";

//This line gets the input

cin>>favFood;

//This line calls the printMessage method

printMessage(favFood);

return 0;

}

4 0
3 years ago
Which part of an I-statement involves a description of your needs or feelings?
kherson [118]

The part of an I-statement that involves a description of your needs or feelings is the Feelings Statement.

The feelings statement is a description of your feelings that is linked to a particular situation. Vague feelings often create frustration in the listener.

5 0
4 years ago
Where can you find additional commands to include in menu options?
Eddi Din [679]

Answer:

Look under Outlook options in the Backstage view

Explanation:

If we want to add more commands in Outlook, we must look under Outlook options in the backstage view.

Then we must click in the option customize ribbon, we are going to see all the commands that we can add.

For example:

We have an option to do a filter in customize ribbon area, we can see the most popular commands or all of them.

We want to add the command New contact, we can choose where to add it, if we make a mistake, we can remove the command.

7 0
3 years ago
Other questions:
  • In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the
    12·1 answer
  • Which type of communication protocol converts data into standard formats that can be used by applications?
    11·1 answer
  • The ________________ command tests connectivity by sending an echo request to a remote computer.
    14·1 answer
  • If an interest inventory reveals that you are highly interested in solitary, introverted work, what might be the best type of ca
    9·2 answers
  • Cheri needs to write a small program that interacts with the user. What step will allow her to do this?
    14·2 answers
  • Use the drop-down menus to complete statements about audio file formats.
    10·1 answer
  • PLS HELP MEE!!!
    12·1 answer
  • What is astronaut favourite key on keyboard? ​
    13·2 answers
  • PLEASE HELP
    12·1 answer
  • An Inspect and Adapt (I&amp;A) event is occurring and a program is trying to address a long-existing problem (WIP)?"unreliable P
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!