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
gayaneshka [121]
3 years ago
11

You are given a class named Clock that has three instance variables: One of type int called hours, another of type boolean calle

d isTicking, and the last one of type int called diff.Write a constructor for the class Clock that takes three parameters—an int, a boolean, and another int.The constructor should set the instance variables to the values provided.
public Clock(){
int hours, diff;
boolean isTicking;
}
Computers and Technology
1 answer:
Ivahew [28]3 years ago
5 0

Answer:

Clock (int hours, boolean isTicking, int diff) // constructor clock

{

this.hours = hours;

// set the instance variable hours

this.isTicking = isTicking;

// set the boolean variable isTicking

this.diff =diff;

//set the instance variable diff

}

Explanation:

Here we declared a constructor clock which has 3 parameter hours,boolean isTicking,and diff.

The int hours, diff is of int type and isTicking is of boolean type. In this constructor, we set the instance variables values by using this keyword.

You might be interested in
The most popular input device of a computer is a(n) ____.
zaharov [31]
A keyboard and a mouse

7 0
3 years ago
What is the name of the file manager in microsoft windows?
Ivan
It is called Windows Explorer referred as explorer.exe<span />
7 0
3 years ago
Read 2 more answers
2.8 Code Practice: Question 1
-BARSIC- [3]

Answer:

The program to this question can be given as:

Program:

#include <stdio.h> //define header file

int main() //define main method.

{

int a1,b1,c1; //define variable

printf("Enter three numbers:\n"); //message

scanf("%d",&a1); //input numbers.

scanf("%d",&b1);//input numbers.

scanf("%d",&c1);//input numbers.

if (a1>b1) //check condition

{

//check condition

if(a1>c1)//inner if block

{

printf("The largest number: %d", a1); //message

}

else  //inner else block

{

printf("The largest number: %d", c1);//message

}

}

else //else block

{

//check condition

if(b1>c1) //inner if block.

{

printf("The largest number: %d", b1);//message

}

else //else block

{

printf("The largest number: %d",c1);//message

}

}

return 0;  //return 0.

}

Output:

Enter three numbers:

22

44

11

The largest number: 44

Explanation:

The description of the above program can be given as:

  • In the C language program firstly we define the header file. Then we define the main function. In the main function, we define three variables that are "a1, b1 and c1". In this variable, we take input from the user.
  • Then we define the conditional statements. In the if block we check if the value of a1 is greater then the value of b1 if this condition is true so we use another condition that if the value of a1 is greater then the value of c1. so, it will print the largest value. If the above condition is not true then it will go to else section.
  • In the else part we check the condition that if the value of b1 is greater then the value of c1. if it is true it will print the largest number value.  
4 0
3 years ago
Read 2 more answers
______ behavior expected from every professional​
Shalnov [3]

Answer:

Respectful

Explanation:

3 0
2 years ago
When media is used to communicate with a very large audience, it is referred to as media.
Sophie [7]

Answer:

mass media

Explanation:

6 0
2 years ago
Read 2 more answers
Other questions:
  • You just read an msds for acetic acid. based on what you read, what type of information is included in an msds sheet? record you
    7·1 answer
  • Which of the following has likely attended vocational school?
    10·1 answer
  • Identify the computer cycle in each of the descriptions below by choosing the answer from the
    12·1 answer
  • What is the main role of LDAP?
    14·1 answer
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • Which similar computer network components connect multiple devices?
    7·1 answer
  • Choose the best answer from the drop-down menu. A ______ allows multiple connections to a single signal. Without a ______, conne
    7·2 answers
  • Pleaseee help me with the typical situations of the icons(i already know for words but I have no idea for giving the situations
    5·1 answer
  • What is computer fundamental ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!