Hi! I am doing the Uni work and i stuck with 1 little thing, if anyone can help will be happy!
here is the exercise:
Write a method named SecsIn which accepts three integers representing time in hours, minutes and seconds.
Your method should output the total time in seconds represented by the values.
the problem is:
i want to make it that way, so if user enters the value for hour, minute or second greater then 60, he would be told to do it again, and the program would calculate only if the values are right. So far it calculates even if they are wrong, but gives the message.
static void Main(string args)
Console.WriteLine("Calculate the Time\nEnter the value of hour, minute and second\nThe value of them can not be greater then 60");
Hour = int.Parse(Console.ReadLine());
Minute = int.Parse(Console.ReadLine());
Sec = int.Parse(Console.ReadLine());
if (Hour <= 60 && Minute <= 60 && Sec <= 60)
Console.WriteLine("The Time is");
Console.WriteLine("Wrong values Enter the values again");