Question: Problem 4-Write methods Submit a program called: directMethods java 1. Create a method called time() that takes an integer (total number of seconds) and outputs

 Problem 4-Write methods Submit a program called: directMethods java 1. Create

Problem 4-Write methods Submit a program called: directMethods java 1. Create a method called time() that takes an integer (total number of seconds) and outputs to screen a clock in 24 hour format (hours, minutes and seconds). The return value should be the number of hours. If the number of seconds entered is greater than the number of seconds in a day, the method should return-1. 2. Create a method called prime() that checks if a number is prime or not. It should return true if it is prime and false otherwise.. 3. Create a method called allFactors) that prints out all the factors of a given number. The return value should be the number of factors. 4. Create a main method using these methods. Your main method should only contain three lines: T System.out.printin(time(18000) System.out.printin(prime(13)); System.out.printin(allFactors(100))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!