Question: Write a method daysToSeconds that reads from user the number of days ( int ) . The method should then convert the number of days

Write a method daysToSeconds that reads from user the number of days (int). The method should then convert the number of days to seconds and display the result to the user. Make sure user input is always positive. 1 day consists of 86400 seconds.
Requirements:
You must comment your code appropriately
Your code must be as efficient as possible
All number literals need to be set as constant
Note: You can assume that Scanner class is already imported for you.
For example:
Test Input Result
daysToSeconds();
43
Enter number of days:
43 days consists of 3715200 seconds!
daysToSeconds();
0
Enter number of days:
Invalid input
it should start with public static void daysToSeconds(){
// Write your code for the method here

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!