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
Shtirlitz [24]
3 years ago
13

Complete the missing code in the templatepublic class Exercise09_04Extra { public static void main(String[] args) { SimpleTime t

ime = new SimpleTime(); time.hour = 2; time.minute = 3; time.second = 4; System.out.println("Hour: " + time.hour + " Minute: " + time.minute + " Second: " + time.second); } } class SimpleTime { // Complete the code to declare the data fields hour, // minute, and second of the int type }
Computers and Technology
1 answer:
snow_lady [41]3 years ago
3 0

Answer:

The code to this question can be given as:

code:

public class Exercise09_04Extra //define class

{

public static void main(String[] args) //define main method

{

SimpleTime time = new SimpleTime(2,3,4);

//create object of the class

System.out.println("Hour: " + time.hour + " Minute: " + time.minute + " Second: " +time.second); //print result

}

}

class SimpleTime //define class

{

int hour,minute,second; //set three integer variable

SimpleTime( int hour, int minute, int second ) //define parameterized constructor

{

this.hour = hour;

this.minute = minute;

this.second = second;

}

}

Output:

Hour: 2 Minute: 3 Second: 4

Explanation:

In the above java code firstly we define a main class that is Exercise09_04Extra. In this class we create another class object that is SimpleTime . Then we call parameterized constructor and print the values. When we call the SimpleTime class in this class we define an integer variable that is hour, minute and second and create the parameterized constructor and pass the variable as a parameter.In this constructor we use this keyword to hold the value of the passing variable. So the output of the following code is "Hour: 2 Minute: 3 Second: 4 ".

You might be interested in
If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
fredd [130]
You should use an American Express.
5 0
3 years ago
Threads in the ____ are idle, pending availability of a cpu.
slava [35]
Run queue. They can also be waiting on I/O.
7 0
4 years ago
PLEASE I NEED HELP ASAP PLEASE PLEASE!!!
aniked [119]

Answer:

Following are the program in the Python Programming Language

#set variables to 0

positive_sum=0  

negative_sum=0  

#print message  

print("Enter 0 to terminate")  

#set the while loop  

while(True):  

#get input from the user  

num=float(input("Enter positive or negative numbers: "))  

#set if statement to check condition  

if(num==0):  

  break  

elif(num>0):  

  positive_sum+=num  

else:  

  negative_sum+=num  

#print output with message  

print()  

print("sum of positive numbers: ", positive_sum)  

print("sum of negative numbers: ", negative_sum)  

Output:  

Enter 0 to terminate  

Enter positive or negative numbers: 1  

Enter positive or negative numbers: 3  

Enter positive or negative numbers: 5  

Enter positive or negative numbers: -7  

Enter positive or negative numbers: -2Enter positive or negative numbers: 0  

sum of positive numbers:  9.0  

sum of negative numbers:  -9.0

Explanation:

Here, we set two integer data type variables "positive_sum", "negative_sum" and initialize to 0.

Then, we set the while infinite loop inside the loop.

Set a variable "num" and get input from the user in it.

Set the if conditional statement and check condition the variable "num" is equal to 0 then, loop will terminate.

Set the elif statement and check condition the variable "num" is greater than 0 then, add that input and store in the variable "positive_sum"

Otherwise, add that input and store in the variable "negative_sum".

Finally, we print the output with the message.

8 0
2 years ago
Making __________ cache a part of the processor caused manufacturers to move from sockets to slots in the late 1990s
iren2701 [21]

Answer:

The description of the discussion has been illustrated throughout the explanation segment elsewhere here.

Explanation:

  • Processors started to incorporate constructed L2 cache, acquired as completely separate chips from multiple vendors of Static Random access memory chip.
  • This same processor and after that usually consists not of even single, and therefore of many other processors, that everything positioned upon its motherboard, which would then be inserted into another motherboard socket.

4 0
3 years ago
What does mean I can’t turn on my computer and my computer won’t charge at all
Dmitrij [34]

Explanation:

well that happened to me to and what my dad did was to cut the cable and fix it,it worked.Ithink my situation is very different than yours but you cantiue to see what else it says and if you want to you can text me back.

5 0
3 years ago
Other questions:
  • select three types of school which specifically emphasize learning through creativity, self expression, and play
    10·2 answers
  • Create a test that prompts a user to enter a 5-digit PIN in the main procedure and then calls Validate PIN procedure to validate
    12·1 answer
  • ITS MAKING ME TYPE URL CODES NOW!
    6·1 answer
  • Randy earn $22 per hour. This is an example of
    11·1 answer
  • A Layer 2 switch configuration places all its physical ports into VLAN 2. The IP addressing plan shows that address 172.16.2.250
    7·1 answer
  • How should you best communicate<br> this information to Keisha?<br> (Select all that apply.)
    13·1 answer
  • This is a type race kindly join.
    11·1 answer
  • What do artists often use to create illusions in an Image?
    15·2 answers
  • The computer that has been traditionally found on the desks in many offices and homes is the ___ computer.
    8·1 answer
  • What does a computer monitor look like when struck really hard?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!