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]
4 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]4 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
Which best describes the condition under which the Unicode output is the same as plain text?
Nostrana [21]

Answer:

When the text contain the ASCII code (Which contains the character) is the correct answer of the above question.

Explanation:

ASCII is used for the Unicode for the computer system. The full form of this is the American standard code of information interchange.  It is a code that is used by the computer system for their personal use. It is because no one can hack the information from the system. If anyone can do so then they can get that text which has no mean.

The above question asked about the condition in which Unicode output is the same from plain text. So the answer is ASCII code because the ASCII code and the Unicode are the same. The only difference between them is the representation of bits.

3 0
3 years ago
Address whether each defense method listed above (single router, defense-in-depth, and demilitarized zone) is sufficiently diffe
bagirrra123 [75]

Answer:

Check the explanation

Explanation:

1) The single router approach is a security Implementation of all security policies and the defense-in depth approach employs a firewall. the DMZ approach Is establish between two routers with a firewall.

2) The single router approach is for small offices and homes.

The defense in depth approach is for large organizations.

The DMZ approach is for publicity operated networks.

3) The DMZ can provide better defense because it has more than two firewall for increased security.

5 0
4 years ago
What does the average function do in a spreadsheet?
givi [52]
This article describes like shows the formula syntax and usage of the AVERAGE<span>  function in Microsoft Excel</span>
8 0
4 years ago
Summary In this lab, you declare and initialize variables in a C++ program. The program, which is saved in a file named NewAge.c
AVprozaik [17]

Answer:

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>  int myNewAge;</em>

<em>  int myCurrentAge = 29;</em>

<em>  int currentYear = 2020;</em>

<em> </em>

<em>myNewAge = myCurrentAge+(2050-currentYear);</em>

<em />

<em>cout<<"My Current Age is "<<myCurrentAge<<". I will be "<<myNewAge<<" in 2050"<<endl;</em>

<em>    return 0;</em>

<em>}</em>

Explanation:

The program is written in C++ language as required. firstly, we declare the three variables:

<em>  </em><em>int myNewAge;</em>

<em>  int myCurrentAge = 29;</em>

<em>  int currentYear = 2020;</em>

Then we calculate the new age as: <em>myNewAge = myCurrentAge+(2050-currentYear);</em>

Using multiple cout operators (<em> </em><<) we display the output nicely as required by the question with this statement

<em>cout<<"My Current Age is "<<myCurrentAge<<". I will be "<<myNewAge<<" in 2050"<<endl;</em>

7 0
3 years ago
Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find
Gnoma [55]

Answer:

def find_max(num_1, num_2):

   max_val = 0.0

   if (num_1 > num_2): # if num1 is greater than num2,

       max_val = num_1 # then num1 is the maxVal.

   else: # Otherwise,

       max_val = num_2 # num2 is the maxVal

   return max_val

max_sum = 0.0

num_a = float(input())

num_b = float(input())

num_y = float(input())

num_z = float(input())

max_sum = find_max(num_a, num_b) + find_max(num_y, num_z)

print('max_sum is:', max_sum)

Explanation:

I added the missing part. Also, you forgot the put parentheses. I highlighted all.

To find the max_sum, you need to call the find_max twice and sum the result of these. In the first call, use the parameters num_a and num_b (This will give you greater among them). In the second call, use the parameters num_y and num_z (This will again give you greater among them)

5 0
3 years ago
Other questions:
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    6·1 answer
  • As referenced in this Canvas guide (Links to an external site.), Canvas is best viewed at a minimum of 800x600 pixels, which is
    5·1 answer
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • ________ means that IT capacity can be easily scaled up or down as needed,which essentially requires cloud computing. A) agility
    15·1 answer
  • Imagine you're developing a Pokemon game, and you need to implement the battle party mechanic. Recall that the player's party ca
    10·1 answer
  • As your textbook explains, Wikipedia is usually the only source you need when
    8·1 answer
  • Write a program that will sort an array of data using the following guidelines - DO NOT USE VECTORS, COLLECTIONS, SETS or any ot
    10·1 answer
  • How many triangles can you make if the side lengths are 4 cm, 5 cm, and 11 cm?
    10·1 answer
  • How to run angular project from github.
    7·1 answer
  • Which of the following will Excel recognize as a date?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!