Hi I have my code but can't figure out the last part of this.
Here is my code:
using System;
public class CalculateTime
{
// Main method entry point
public static void Main()
{
//initialize variabls
int seconds = 0;
//input number of seconds
string inputSeconds;
Console.Write("Input the number of seconds: ");
inputSeconds = Console.ReadLine();
seconds = Convert.ToInt32(inputSeconds);
//call CalcMin method
CalcMin(seconds);
}
//CalcMin method
public static void CalcMin(int x)
{
int totalMinutes = 0, totalSeconds = 0;
totalMinutes = x / 60;
totalSeconds = x % 60;
//output number of minutes and seconds
Console.WriteLine("{0} minute(s), {1} second(s)", totalMinutes, totalSeconds);
}
}
the last part should be as follows:
Add a second method to the solution. This method displays a passed argument as hours, minutes and seconds. For example 3666 seconds is 1 hour, 1 minute and 6 seconds.
2006-11-25
13:35:00
·
1 answers
·
asked by
Christina
2
in
Computers & Internet
➔ Programming & Design