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
Allushta [10]
3 years ago
13

Create a public class Dog that stores a single double age set by the constructor. (Reject negative ages using assert.) Dog shoul

d also provide a single class method named isOlder. isOrder should accept two Dog instances and return true if the first is older than the second, and false otherwise. You should also assert that both passed instances are not null.
Computers and Technology
1 answer:
hjlf3 years ago
7 0

Answer:

Explanation:

The following is written in Java and has the methods as requested in the question...

class Dog {

   private double age;

   public Dog(double v) {

       assert v >= 0:" Not valid";

       this.age = v;

   }

   public boolean isOlder(Dog dog1, Dog dog2) {

       if (dog1.age > dog2.age) {

           return true;

       } else {

           return false;

       }

   }

}

You might be interested in
Which method will return the first element in an ArrayList employees?
Wittaler [7]

Answer:

employees.get(0)

Explanation:

In the programming, the index of ArrayList start from zero.

So, the element start storing in the ArrayList from the zero index.

get() is the function which is used to retrieve or getting the value in the

ArrayList.

The function employees.get(0), it retrieve the element of zero index.

The function employees.get(1), it retrieve the element of first index.

The function employees.first(1), it is wrong calling.

The function employees.get(), it is wrong calling. you have to enter the index value inside the get().

3 0
3 years ago
Telepresence provides the opportunity for people to work from home and attend virtually. True False
ira [324]
The answer is true.
Telepresence is essentially things like video-chat that allows people to participate in meetings even if they are not physically present.

I hope this helps! :)
~ erudite 
7 0
3 years ago
Read 2 more answers
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
Ou are a web page designer and you set up a page with five different links. a user of the page can click on one of the links or
sertanlavr [38]

There are 6 possible outcomes and they are :

S={link1,link2,link3,link4,link5,leave}

this is the sample space for the outcome of a visitor to your webpage.

8 0
3 years ago
How many bytes are in a megabyte?
Ivenika [448]
1,000,000 bytes are in 1 megabyte.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Describe a situation where it would be advantageous to use the copper tape or aluminum foil instead of the A and B push buttons
    7·2 answers
  • A(n) ____ is a location on your computer screen where you type text entries to communicate with the computer’s operating system.
    9·2 answers
  • How many pairs of chromosomes do human body cells contain?
    7·2 answers
  • If a firm's pages are not near the top of query results, customers may never discover its website. This has led to _____ becomin
    12·1 answer
  • How can I do a project with a model on the steam machine?
    14·1 answer
  • Another name for the office button menu is the toolbar. true or false.
    7·2 answers
  • Catherine purchased dried herbs from the grocery store. Which structure would she use if wanted to create a mixture of powdered
    8·2 answers
  • What is the exclusive legal right granted to all authors and artists that gives them sole ownership of their work to print, publ
    5·2 answers
  • Matching parentheses. An math expression may have a number of parentheses like (, ), [, ], { and }. Each openning parenthesis (,
    5·1 answer
  • What is output by the following code?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!