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 program that unpickle's employee dictionary and while reading from the dictionary, it allows users to lookup an employee
melamori03 [73]

Answer:

Check the explanation

Explanation:

from Employee import *

import pickle

import random

def unpickle_employee(filename):

file=open(filename,'rb')

data=pickle.load(file)

file.close()

return data

def pickle_employee(data,filename):

file=open(filename,'wb')

pickle.dump(data,file)

file.close()

if __name__=='__main__':

filename="Employees.dat"

'''

E=Employee("Ajay",1,"R&D","Manager")

data={}

data[1]=E

pickle_employee(data,filename)

'''

data=unpickle_employee(filename)

 

while True:

print("\nData In Employee.dat")

for d in data:

print("Employe data: ",data[d].get_name(),"({},{},{})".

format(data[d].get_id_number(),data[d].get_department(),data[d].get_job_title()))

 

print("\n\n\t\tMenu")

print("To add new Employee, Enter a")

print("To update any Employee, Enter u")

print("To delete any Employee, Enter d")

print("Enter anything to quit")

choice=input("Enter: ")

if choice=='a':

id_number=random.randrange(100,200,1)

while id_number in data:

id_number+=1

if id_number>=200:

id_number=100

name=input("Enter the Name: ")

department=input("Enter the Department: ")

job_title=input("Enter the job title: ")

E=Employee(name,id_number,department,job_title)

data[id_number]=E

elif choice=='u':

id_number=int(input("Enter the Employee id_number to update: "))

for d in data:

print(id_number,d,d==id_number)

if id_number in data:

print("Employe data: ",data[id_number].get_name(),"({},{})".

format(data[id_number].get_department(),data[id_number].get_job_title()))

print("\nPlease Enter the details")

name=input("Enter the Name: ")

department=input("Enter the Department: ")

job_title=input("Enter the job title: ")

E=Employee(name,id_number,department,job_title)

data[id_number]=E    

else:

print("Employee doesn't exist\n")

elif choice=='d':

id_number=int(input("Enter the Employee id_number to delete: "))

if id_number in data:

print("Employe data: ",data[id_number].get_name(),"({},{})".

format(data[id_number].get_department(),data[id_number].get_job_title()))

choice=input("\nPlease Enter y to confirm, anything else to cancel: ")

if choice=='y':

del data[id_number]

else:

print("Employee doesn't exist\n")

else:

break

pickle_employee(data,filename)

7 0
2 years ago
There are some network modeling tools that can ________ the existing network.
lesya [120]
<span>There are some network modeling tools that can scan the existing network.</span>
4 0
3 years ago
Read 2 more answers
Double bar graphs compare multiple what
GalinKa [24]
You would multiply by 2
7 0
3 years ago
Given an input array of strings (characters) s, pick out the second column of data and convert it into a column vector of data.
hodyreva [135]

Answer:

Consider the following code.

Explanation:

save the following code in read_and_interp.m

 

function X = read_and_interp(s)

[m, n] = size(s);

X = zeros(m, 1);

for i = 1:m

if(str2num(s(i, 2:5)) == 9999)

% compute value based on previous and next entries in s array

% s(i, 2:5) retrieves columns 2-5 in ith row

X(i,1) = (str2num(s(i-1 ,2:5)) + str2num(s(i+1,2:5)))/2;

else

X(i,1) = str2num(s(i,2:5));

end

end

end

======================

Now you can use teh function as shown below

s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ];

read_and_interp(s)

output

ans =

96.000

114.000

109.500

105.000

112.000

7 0
3 years ago
The function of an audio mixer is to _____. layer audio tracks at their ideal volume combine, control, and route audio signals f
larisa [96]

Answer: combine, control, and route audio signals from inputs to outputs

Explanation:

A audio mixer is refered to as the sound mixer or the mixing console and it's an electronic device that's used for mixing, and combining several audio signals and sounds.

The input to the console is the microphone. The audio mixer can also be used in controlling digital or analog signals. These are then summed up in producing output signals.

Therefore, the function of the audio mixer is to combine, control, and route audio signals from inputs to outputs.

7 0
2 years ago
Other questions:
  • Look at the four schematic symbols shown in the figure above. Each of the symbols is labeled with a number. Which of the followi
    5·2 answers
  • Reflexes are basically "hard-wired" into the CNS. Anatomically, the basis of a reflex is an afferent neuron that synapses direct
    10·1 answer
  • What is the lowest and highest address of a 2^20 byte memory, if it is byte readable.
    11·1 answer
  • Multiple users report that the network printer, which is connected through the print server, is not printing. Which of the follo
    12·1 answer
  • Write a Program in C language using arrays:
    14·1 answer
  • Can I change my username?
    6·1 answer
  • What are potential problems with using nanorobots ?
    14·1 answer
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • After Alexandra installed new software, she set it up to perform in a certain way. She is _____. changing the peripherals linkin
    10·1 answer
  • I hope The characters That I want in Mortal kombat 12 is Lori and peron That’s My character wishlist in The next Mortal kombat g
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!