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
ch4aika [34]
3 years ago
12

A class named clock has two instance variables : hours (type int ) and isticking (type boolean ). write a constructor that takes

a reference to an existing clock object as a parameter and copies that object 's instance variables to the object being created. your task: write a clock constructor that makes this possible. just write this constructor -- don't write the whole class or any code outside of the class !
Computers and Technology
1 answer:
Leno4ka [110]3 years ago
3 0
<span>I guess you need it written in Java. So if you need only constructor, then here it is:
public Clock(Clock clock1) {
          this.hours = clock1.hours;
          this.isTicking = clock1.isTicking;
}

This code is 100% correct</span>
You might be interested in
Write a class named Averager containing: An instance variable named sum of type integer, initialized to 0. An instance variable
vladimir1956 [14]

Answer:

The answer to this question can be given as:

Class definition:  

public class Averager  //define class Average.

{

private int sum = 0;

 //define variable sum.

private int count = 0;

 //define variable count.  

public int getSum() //define function getSum().

{

return sum;  //return value.

}

public void add(int x)

//define function add().

{

sum = sum + x;   //calculate sum

count=count+1; //increase value of count.

}

public int add(int x)

 //define function add().

{

return count;  //return value.

}

public double getAverage()  //define function getAverage().

{

return (double)sum/count;  //return value

}

}

Explanation:

The above class definition can be described as:

  • In the above class definition first we define a class that is " Averager". In this class we define two integer variable  that is "sum and count"  and assign a value that is 0. Then we define a functions :
  • First we define getSum() function in this function we does not pass any value and the return type of this function is int that will return an integer value.
  • Then we define add() function we use this function two times but both functions have different from each other.  
  • In first time implementation, we define this function and the return type of this function is void which means it does not return any value. In this function, we calculate the sum value and increase the value of the count variable by 1.  
  • In second time implementation, we define this function and the return type of this function is int which means it will return a value. In this function, we will return the count variable value.
  • At the last, we define a getAverage() that calculates the average of the added values in the sum variable and returns its value.
3 0
3 years ago
after placing her insertion point after grandma's kitchen, order the steps Danica needs to follow to insert and format the regis
KengaRu [80]

Answer:

step 4

step 5

step 3

step 2

Explanation:

8 0
3 years ago
Read 2 more answers
Write a public interface named Test with the following behavior:
enyata [817]

Answer:

The code to this question can be given as:

Code:

public interface Test  //define interface  

{

   public abstract Duration getDuration(); //define method

getDuration.  

   public abstract Result check(int a);

//define method

check .

   public abstract double getScore();

//define method getScore.  

}

Explanation:

In the above code, we define an interface that is "Test" inside an interface, we define three methods that can be defined as:

  • First, we define a method that is "getDuration" that method returns  Duration as an object.
  • Second, we define a method that is "check" this method accepts an integer parameter that is a and return Result.
  • The third method is "getScore" this method will return a double value.
8 0
3 years ago
Who here has an old (preferably 80s) Toyota Celica i just bought mine and want to know how you guys like yours because mine is f
Maurinko [17]

Answer:

Explanation:

The 1980 Toyota Celica is a great car, it was my first car and I loved it. It has many luxury features that you don't see much in cars of that year. It is also extremely reliable and can take lots of use before beginning to give problems. I used to use it to get to and from school on a daily basis and it never once left me stranded. It includes power steering, cruise control, AC, etc. Not much more you can ask for in a car, it is also a very beautiful looking car, especially a well taken care of one. Enjoy your car.

8 0
2 years ago
Interactive television with video-on-demand capabilities changes how people watch television and how consumers access the Intern
Alex787 [66]

Answer:

High learning

Explanation:

High Learning means that a product require significant customer education before customers understand how the product functions and that may make the product stay longer in the introduction stage whilst the customers are being familiarize with it. Examples are microwave ovens.

6 0
3 years ago
Other questions:
  • Can someone fix this so that it only says "its a payday" on 15 and 30 and on all other days "sorry, it's not payday"
    9·1 answer
  • One reason for using social media is to develop social and professional contacts. True or false?
    9·2 answers
  • Due to the absorption and scattering of shorter wavelengths by interstellar dust, distant stars appear A) bluer. B) brighter. C)
    9·1 answer
  • Fax machines, voice mail, electronic mail, and electronic conferencing are all examples of _________.
    15·2 answers
  • What symbol following a menu command lets you know that a dialog box will be displayed? an arrow a check mark an ellipse a radio
    5·2 answers
  • Part 1 Create a program that asks the user for a temperature in Fahrenheit, and then prints the temperature in Celsius. Search t
    12·1 answer
  • For what kind of shot is a fisheye lens most appropriate?
    8·1 answer
  • What is the safest way to shut down a desktop or laptop computer?
    8·1 answer
  • the tool that is used on the form to display text that the user cannot change is a. textbox b. label c. button​
    9·1 answer
  • Identify some advantages of using Excel over lists, paper files, or simple word documents? Describe some disadvantages of using
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!