(Hours, minutes, and seconds) Write a method that returns a string in the form of hour:minute:second for a given total seconds using the following header:
public static String format(long seconds)
Here is a sample run:

Enter total seconds: 342324
The hours, minutes, and seconds for total seconds 342324 is 23:05:24

Note that a zero is padded to hour, minute, and second if any of these values is a single digit.

Answers

Answer 1

Answer:

Answered below.

Explanation:

class Convert {

public static String format(long seconds) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter total seconds: ");

int secs = sc.nextInt();

int hours = secs / 3600;

int minutes = (secs % 3600) / 60;

int seconds = (secs % 3600) % 60;

String timeFormat = hours + ":" + minutes + ":" + seconds;

return timeFormat;

}

}


Related Questions

From the philosophical standpoint, especially in the discussion of moral philosophy or ethics, why do we consider “murder” or “killing” wrong or bad?

Answers

Explanation:

Morality is a set of values ​​and habits that a society acquires over time and can be categorized as good and bad values, right and wrong, justice and crime. Ethics is defined as the study of morals, the practical application of moral behaviors defined by society.

Therefore, the concept of "murder" or "killing" is seen as an immoral act by the vast majority of society around the world, strengthened by the set of moral conduct common to all human beings, which are the Articles on the Universal Declaration of Human Rights. Human Rights, which is an official document of the UN, which contains several universair and analytical rules on the rights of every individual, such as the right to life, security, freedom, etc.

Other Questions
The evidence presented in this excerpt best supports the authors claim that McDonalds is the leader in fast food innovation. fast food restaurants use technology designed to reduce the need for skilled labor. technology has helped improve the fast food industry. the workers limited skills have forced fast food employers to rely on machines instead of people. Large Stock Dividend and Forward Stock Split Low Corporation has 50,000 shares of $40 par value common stock outstanding and retained earnings of $1,500,000. The company declares a 100 percent stock dividend. The market price at the declaration date is $40 per share. a. Prepare the journal entries for (1) the declaration of the dividend and (2) the issuance of the dividend. are these correct??? A retiree invests $7,000 in a savings plan that pays 7% per year. What will the account balance be atthe end of the first year? With a partner, identify trvo or three revolutions that occurred more than ten years ago. What circumstances, if any, do these revolutions have in common? What sorts of goals were the revolutionaries seeking to accomplish? In retrospect were the revolutions successful? Right will be marked brainlist The characteristics of metallic bonds fit nicley into a predictable pattern. True or False? Explain why soils have different level of consistency. HELP ME I HAVE 3 MINUTES LEFT What does sentir mean in English?to feelto killto orderto drinkhurry please PLEASE HELP ME ASAP 5. The title of Passage 1 says Bessie Coleman broke barriers as first African American female to fly. Fill in the circle before the sentence that best supports that statement. (RI 3.8) A She spent her savings learning French and headed to Paris in 1920. B She became famous for her ability to do complex stunts in the air. C Coleman said she knew there were no African-American pilots. D She also knew her race needed to be represented in flying. E So I thought it my duty to risk my life to learn aviation and to encourage flying among men and women of our race," she said.6. Which two sentences should be included in a summary of Passage 1? (RI 1.2) A Bessie Coleman was born January 26, 1892. B Bessie Coleman persevered to become the first African American female pilot in the United States. C The Wright Brothers were the first to build a flying airplane. D Bessie Coleman was mistreated because of her race and gender. E Segregation refers to the separation of specific people groups. 7. What does the word credited mean as it is used in paragraph 3? (RI 2.4) She was inspired by World War I stories and the famous Wright brothers. They are credited with building and flying the world's first airplane. A known as the ones that first built an airplane B given money for building the first plane C told to build the first plane D overlooked as the first ones that built the plane 8. What role does paragraph 2 have in Passage 1? (RI 2.5) A explains why Coleman wanted to become a pilot B describes ways that Coleman showed bravery C compares Coleman to the Wright Brothers D explains how others honor Coleman and her legacy9. This question has two parts. First, answer Part A. Then, answer Part B. (RI 3.8) Part A Which sentence gives a point made by the author of Passage 2? (RI 3.8)A Dorothy Vaughn was a successful mathematician. B Dorothy Vaughn struggled to fly spacecraft. C Dorothy Vaughn was the first female to travel to space. D Dorothy Vaughn relied on other women to help her achieve her goals. Part B Which sentence from Passage 2 provides evidence for the answer in Part A? A She also became a dedicated advocate for female employees who deserved promotions or raises, often supporting white women as well. B ...Vaughan became the manager of her division and its first black supervisor. C ...Vaughan was part of a team that did mathematical calculations to help launch satellites and later humansinto space. D ...she learned computer programming and worked on the program that launched John Glenn and other astronauts into space for the first time.10. How does the image contribute to your understanding of Passage 2? (RI 3.7) A by showing how complex space shuttles are during a launch B by showing how much smoke a space shuttle launch has C by showing the math calculations Vaughan has to complete D by showing that they launch space shuttles during the day Now answer Number 11 based on Queen Bessie and Dorothy Johnson Vaughan. 11. Based on the information in Passages 1 and 2, which claim is supported in both texts? (RI 3.8) A People risk their lives to learn aviation. B Scientists break barriers to make changes in their profession. C People overcome challenges to become successful in their careers. D Pilots become famous by navigating complex stunts What type of fallacy or faulty reasoning is used in this passage? x ad populum O begging the claim O genetic fallacy O hasty generalization Stock MarketCrashThe DustBowlBankHolidayWhat is an appropriate title for this graphic organizer? (d) State any two(2) properties of a semiconductor material. Fill in the blank with the correct conjunction of star.Yo _______ cansado.estoyestamosestasestanP.S I didnt put lines above the letters that need it because my device is not capable. Which television show or movie shows procedures/or a process to collect evidence from a violent crime scene that differs from the actual procedures/process that happen in real life. Then discuss how these two procedures or processes regarding evidence collection portrays the criminal investigation process and how these processes or procedures differ from the actual reality of a crime scene investigation. * Im not really. Interested in crime shows so I dont have a clue A 52-year-old woman has difficulty initiating voluntary movements. She can clearly state what she intends to do, describe exactly how she would do it, and picture herself doing it easily. When she is able to begin the motion, she can complete it smoothly and accurately, but she has difficulty beginning the motion. If the difficulty arises from a defect in one particular area of the nervous system, which area is most likely to be involved Find the area of this parallelogram.A)20 cm2B)24 cm40 cm after one has completed a bachelor's degree what are the next three degrees one can obtain if accepted?