Design a C# solution with a Main ( ) method that holds an integer variable named seconds to which you will assign a value. Create a method to which you pass this value. The method displays the seconds in minutes and seconds. As an example 66 seconds is 1 minute and 6 seconds.
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.
Add a statement to the Main ( ) method so that after it calls the methods to convert seconds to minutes and seconds, it passes the same value to the new method to convert it to hours, minutes and seconds
Here is what I wrote and it's not working.
using System;
namespace time
{
public static void Main()
{
// Declare Variables
int sec;
sec = args[0];
displayTime(sec);
{
TimeSpan ts = new TimeSpan(0, 0, x); // where x is the number of seconds
Console.WriteLine( String.Format("{0} minute{1} and {2} second{3}",
2006-11-25
08:50:10
·
3 answers
·
asked by
Christina
2
in
Computers & Internet
➔ Programming & Design