Hey, I want to know how to make a digital clock in console appl. with hours, mins and seconds. But I don't know how.
The funny thing is that our teacher is kinda bad so I don't get any help from him, which makes it hard to do stuff in C#.
Hey, I want to know how to make a digital clock in console appl. with hours, mins and seconds. But I don't know how.
The funny thing is that our teacher is kinda bad so I don't get any help from him, which makes it hard to do stuff in C#.
I have found an example maybe its helpful for you:
C# Home
Ok guys.
I got this far:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int choice = 0;
int h = 0; /*Hours*/
int m = 0; /*Minutes*/
int s = 0; /*Seconds*/
do
{
Console.WriteLine("My menu");
Console.WriteLine("1- Show watch");
Console.WriteLine("0- Close");
Console.WriteLine("Choice: ");
choice =Convert.ToInt32(Console.ReadLine());
if (choice == 1)
{
//Show the clock
Console.WriteLine("Clock");
Console.ReadLine();
}
} while (choice != 0);
}
}
}
As you can see I did a menu where you can choose between showing the clock and close it.
I must use System.Threading.Thread.Sleep(); and Console.Clear();
Seconds changes to minutes and minutes changes to hours. It starts again after 12 hours.
I've never did anything which contains these. = I need help![]()
Use Timer class. Timer in C#
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum