What is the output for the call displayTime(2, 24, 65)? public static void displayTime (int hr....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What is the output for the call displayTime(2, 24, 65)? public static void displayTime (int hr. int min, int sec ) { if (hr< 1 || hr> 12) { System.out.print("Error: hour"); hr = 1; } if ( min < 1 || min > 59 ) { System.out.print("Error: minute"); min = 1; } if (sec < 1 || sec > 59 ) { System.out.print ("Error: second"); sec = 1; } System.out.println (hr+": + min + ":" + sec ); } What is the output for the call displayTime(2, 24, 65)? public static void displayTime (int hr. int min, int sec ) { if (hr< 1 || hr> 12) { System.out.print("Error: hour"); hr = 1; } if ( min < 1 || min > 59 ) { System.out.print("Error: minute"); min = 1; } if (sec < 1 || sec > 59 ) { System.out.print ("Error: second"); sec = 1; } System.out.println (hr+": + min + ":" + sec ); }
Expert Answer:
Answer rating: 100% (QA)
There are several syntax errors and typos in the code provided After cor... View the full answer
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Posted Date:
Students also viewed these programming questions
-
What is the output of this code? Explain how did you made the file and provide a pic of the out put. import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class...
-
As business office manager of Group HMO, Inc., Dana Smith was responsible for the work of approximately 45 employees, of whom 26 were classified as secretarial or clerical. At the direction of the...
-
Part A Light has both a wave and a particle nature. Particles have a wave nature as well, and therefore All particles decay with a certain characteristic lifetime. Their position can not be specified...
-
K. Nasser and T. Yoko are considering a business venture. They ask you to explain the advantages and disadvantages of the partnership form of organization.
-
The comparative SFP for Cosky Corporation follows: Additional information: 1. Dividends of $15,000 were declared and paid in 2020. 2. There were no unrealized gains or losses on the FV-NI...
-
Assuming that the price of fuel is \(\$ 5.00 / \mathrm{GJ}\) and is increasing at a rate of \(4 \% /\) year while the discount rate is \(6 \%\), calculate the equivalent levelized price over 20 years.
-
On October 31, the stockholders equity section of Heins Company consists of common stock $500,000 and retained earnings $900,000. Heins is considering the following two courses of action: (1)...
-
How do concepts of diversity and inclusion vary across different cultural and geographical contexts, and what strategies can multinational organizations employ to navigate these variations...
-
The first-quarter tax return needs to be filed for Prevosti Farms and Sugarhouse by April 15, 2022. For the taxes, assume the second February payroll amounts were duplicated for the March 4 and March...
-
You are looking at a lab specimen that is mounted 2.00 cm from the objective lens of your microscope. If the barrel length of the microscope is 16.0 cm and the focal length of the eyepiece is 5.90...
-
What could be three workplace takeaways of having an Entertainer Personality? If this person with Entertainer Personality is a key project team member and works hard on the project deliverables. How...
-
What is the future of military robots? Should address all four of the following 1- What is the homepage of the main site on which this page appears (provide the URL), and what can you learn about the...
-
QUESTION: Apply the concepts of plant-within-a-plant (PWP) and mass customization to service organizations. Discuss. QUESTION: What are the five types of customer-induced variability that impact...
-
Evaluate a great leader The leader that we picked is Mustafa Kemal Ataturk(Founder OF TURKEY) Take some time now to evaluate the great leader you identified against the keys of leadership we just...
-
what does designing the support entail? -conducting the analysis of alternatives (AoA) -planning for eventual system retirement and disposal -documenting the product support strategy (PSS) in the...
-
1 Prepare a horizontal analysis of the balance sheet and income statement. 2 Prepare a vertical analysis of the balance sheet and the income statement. tesla-1.pdf Assets Current assets Cash and cash...
-
Write the statement to store the contents of the txtAge control in an Integer variable named intAge.
-
What modifier specifies that a variables value is fixed/constant?
-
You can declare reference variables to have an interface type and use them just as you would use reference variables declared to be the type of a class in an inheritance hierarchy. (T / F)
-
Why does source code have comments?
-
In February 2014, Maria bought a diamond necklace for 13,500. In 2017 the necklace was stolen and, as a result, an insurance payment of 14,000 was received in February 2018. In the same month, Maria...
-
Jerome made the following gifts to family members during tax year 2023-24: (1) On 28 May 2023, Jerome made a gift of a house valued at 187,000 to his wife. His uncle had originally purchased the...
-
Yvonne had the following transactions in the shares of Scotia plc: Sally's capital gains tax position in 2023-24 was as follows: You are required to: (a) Calculate Yvonne's chargeable gain. (b)...
Study smarter with the SolutionInn App