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
Vadim26 [7]
3 years ago
9

Write a method that accepts a number of seconds and prints the correct number of hours, minutes, and seconds.

Computers and Technology
1 answer:
tiny-mole [99]3 years ago
7 0

Answer:

This solution is implemented in Java

public static void timme(int seconds) {

       int hours = seconds/3600;

       System.out.println("Hours: "+hours);

seconds = seconds - hours * 3600;

       int minutes = seconds/60;

       System.out.println("Minutes: "+minutes);

seconds = seconds - minutes * 60;

       System.out.println("Seconds: "+seconds);

   }

   

Explanation:

This method defines the method along with one parameter

public static void timme(int seconds) {

This calculates hours from the seconds

       int hours = seconds/3600;

This prints the calculated hours

       System.out.println("Hours: "+hours);

This calculates the seconds remaining

    seconds = seconds - hours * 3600;

This calculates the minutes from the seconds left

       int minutes = seconds/60;

This prints the calculated minutes

       System.out.println("Minutes: "+minutes);

This calculates the seconds remaining

    seconds = seconds - minutes * 60;

This prints the seconds left    

  System.out.println("Seconds: "+seconds);

   }

You might be interested in
What kind of personal information are you comfortable sharing with others online? Why? What steps do you take to control how tha
GaryK [48]

Answer:

this is more of an opinion question regarding what you personally do

8 0
3 years ago
Read 2 more answers
A file named 'input.txt' contains a list of words. Write a program that reads the content of the file one word at a time. Check
Margarita [4]

Answer:

// here is code in java.

import java.io.*;

import java.util.Scanner;

class Main{  

    // function to check a word is palindrome or not

 private static boolean is_Palind(String str1)

 {

     // if length of String is 0 or 1

   if(str1.length() == 0 || str1.length() == 1)

   {

     return true;

   }

   else

   {

       // recursively check the word is palindrome or not

     if(str1.charAt(0) == str1.charAt(str1.length()-1))

     {

       return is_Palind(str1.substring(1,str1.length()-1));

     }

     

     else

     {

       return false;

     }

   }

 }

// driver function

 public static void main(String[] args)

 {// variable to store word

   String word;

   // BufferedWriter object

   BufferedWriter buff_w = null;

   // FileWriter object

   FileWriter file_w = null;

   // Scanner object

   Scanner sc = null;

   try

   {

       // read the input file name

     sc = new Scanner(new File("input.txt"));

     // output file

     file_w = new FileWriter("output.txt");

     // create a buffer in output file

     buff_w = new BufferedWriter(file_w);

     

     // read each word of input file

     while(sc.hasNext())

     {

       word = sc.next();

     // check word is palindrome or not

       if(is_Palind(word))

       {

           // if word is palindrome then write it in the output file

         buff_w.write(word);

         buff_w.write("\n");

       }

     }

     // close the buffer

     buff_w.close();

     // close the input file

     sc.close();

   }

   // if there is any file missing

   catch (FileNotFoundException e) {

     System.out.println("not able to read file:");

   }

   // catch other Exception

   catch (IOException e) {

     e.printStackTrace();

   }

 }

}

Explanation:

Create a scanner class object to read the word from "input.txt" file.Read a word  from input file and check if it is palindrome or not with the help of is_Palind() function.it will recursively check whether string is palindrome or not. If it is  palindrome then it will written in the output.txt file with the help of BufferedWriter  object. This will continue for all the word of input file.

Input.txt

hello world madam

level welcome

rotor redder

output.txt

madam

level

rotor

redder

3 0
3 years ago
How do you add text in Photoshop CC?​
Schach [20]

Explanation:

First select the Type Tool from the Toolbar

Click in the document to view the live preview.

Choose a new font.

Choose a type size.

Add your text.

5 0
3 years ago
One of the Visual Studio 2015 languages that can be used for rapid application development is C#. Another language that supports
Serga [27]

Answer:

Visual Basic is the appropriate answer for the following blank.

Explanation:

Visual Basic is a language based on real events of a third generation for the Module Object model coding model that was originally published and declared legacy in 2008.

  • In an easy to use graphical environment programmers can create a visual basic programming language for software interfaces and codes. VB is the collection of different components used with the help of the forms with specific characteristics and actions.
7 0
3 years ago
You have received a "no boot device found" notification upon booting your system. what does this mean, and what can you do to tr
zloy xaker [14]
Basically no boot device could be 1 of three things listed below.

1. You have connected an incorrect external device and the system responds to boot from this however no operating system is available. Hence the error. What to do : You have disconnect, reset and select the correct bootable device.
2. You have a faulty hardware specifically your bootable harddisk, corrupted or malfunctioning. You have to reformat and correct the bios installed on the disk.
3. You have not selected correct bootable device. - Select the correct harddisk, if you have partition, be sure to select the one with the Operating system is installed to.
8 0
3 years ago
Other questions:
  • What is the result of segmenting a network with a bridge (switch)? (Choose two)
    14·1 answer
  • The number of credits awarded for the CLEP exam is determined by__<br> Help pls!
    15·1 answer
  • Another important mode, XTS-AES, has been standardized by the __________ Security in Storage Working Group. a. IEEE b. ITIL c. N
    9·2 answers
  • Suppose a computer has 16-bit instructions. The instruction set consists of 32 different operations. All instructions have an op
    7·1 answer
  • A technician has been asked to troubleshoot a simple network problem that seems to be caused by software. Which troubleshooting
    7·1 answer
  • 14. You can store data copied from any Office application file with the
    14·1 answer
  • A user complains that her computer is performing slowly. She tells you the problem started about a week ago when new database so
    12·1 answer
  • ______ norms are usually unstated rules that regulate members' interaction.
    12·1 answer
  • The Analytics tracking code can collect which of the following? (select all answers that apply) (1)-Language the browser is set
    15·1 answer
  • Hey does anyone know how to fix a computer that goes on and off. It is a Asus chromebook and putting it into recovery mode didn'
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!