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
In a bubble sort for a list of length n >= 2, in each iteration, the first step is to compare_______.
Hunter-Best [27]

Answer:

the consecutive two elements and swap them based on the value which is larger if we go for ascending order

Explanation:

bubble sort compares 2 consecutive elements of the list and swap them. in one iteration one value will be placed correctly depending on the sorting order either ascending or descending

7 0
2 years ago
How to get the blade out of a pencil sharpener?
agasfer [191]
Poke hole with thin but strong object
Or buy new sharpener
7 0
3 years ago
Write a python function genRandomVect that returns a random 1d numpy array of size (50,) where each element is an integer sample
SSSSS [86.1K]

Answer:

import numpy as np

def genRandomVect():

   arr = np.random.choice(range(100),size=(50,),replace=False)

   return arr

 

print("Random 1D numpy array where each element is an integer sampled from: [0, 100) ")

print( genRandomVect() )

Explanation:

  • Create a function to create a numpy array with random integers in range[0,100) with no duplicates
  • Use the random.choice to select random values from range[0,100)  and size attribute to take the size of the required array .
  • Finally return the numpy array.

6 0
3 years ago
You cannot have memory protection without CPU protection and vice versa. Group of answer choices True
liq [111]
True you cannot have memory protection without cpu protection and vice versa
6 0
2 years ago
Which of the following is another term for a subfolder?
Tomtit [17]
Another term for a subfolder is a 

"D" Child folder. 

A child folder is like an inner version of a root folder, just like a subfolder is to a root folder. 

I hope this helps!
~kaikers

5 0
3 years ago
Read 2 more answers
Other questions:
  • A binary tree is full if all of its vertices have either zero or two children. Let Bn denote the number of full binary trees wit
    7·1 answer
  • Query: [mcdonalds Austin] Viewport: Fresh User Location: within Houston, TX Result Returned: McDonalds location in a neighboring
    7·1 answer
  • Which logging category does not appear in event viewer by default?
    11·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • Can Word Processing (WP) programs be used for DTP? Explain your answer
    7·1 answer
  • Tech A says that gasoline vapors are lighter than air, so inspection pits do not have a fire hazard like above ground hoists. Te
    9·1 answer
  • Computer has brought radical change in every field​
    6·1 answer
  • In this screenshot, the circled item is the
    15·2 answers
  • 16. If a user can make modifications to database objects, what permission has that
    13·1 answer
  • How does your ability to correctly count change affect the impression the customer has of you?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!