VB implementation of the Countdown class code detailed _VB

Source: Internet
Author: User

This article describes the use of VB to make the countdown program used in a module class code, is based on the console countdown program, can be used for VB beginners or VB Enthusiasts Reference learning, of course, the reader can also copy the code into the VB project directly use, but need to create their own relevant code, for beginners, It is also easy to read a piece of code.

The specific function code is as follows:

Module Module1 Sub Main () Dim A As Date Dim h, M, s as Integer Dim n, I as Long Dim x, Z As Long Dim y As Long Con Sole. 
WriteLine ("This program is the countdown program, please division enter the number of hours to countdown, minutes, Seconds") Console.WriteLine ("Please enter the number of hours to be timed (integers greater than 0):") H = console.readline () Console.WriteLine ("Enter a total number of minutes (greater than or equal to 0 and less than 60 integers):") m = Console.ReadLine () Console.WriteLine () Enter the number of seconds to time (an integer greater than or equal to 0 and less than 60): "s = Console.ReadLine () Console.WriteLine (The current system is: {0}, h) A = Now () Console.WriteLine (" When The previous system time is: {0} ", a" Console.WriteLine ("") Console.WriteLine ("************** Countdown Start *****************") Console.WriteLine ( 
"************** Countdown Begins *****************") Console.WriteLine ("************** Countdown begins *****************") Console.WriteLine ("************** Countdown begins *****************") z = 0 x = for i = 0 to H * 3600 + M * + s for n = 0 to 6000000 for y = 0 to-Z = z + 1 Next next If (H <= 0) and (M <= 0) and (S <= 0) Then Exit for If s ; 0 Then s = s-1 Console.WriteLine ("Remaining: {0} hours {1} minutes {2} seconds", H, M, s) If (H &Lt;= 0) and (M <= 0) and (S <= 0) Then Console.WriteLine ("The countdown is complete, the random input character will exit the program:") Exit For End If if s = 0 Then if m > 0 Then m = m-1 s = Console.WriteLine ("Remaining: {0} hours {1} minutes {2} seconds", H, M, s) End If M = 0 and H >  0 and s = 0 Then h = h-1 m = N ' s = Console.WriteLine ("Remaining: {0} hours {1} minutes {2} seconds", H, M, s) If (H <= 0) and (M <= 
0) and (S <= 0) Then Console.WriteLine ("Countdown completed, random input character will exit program:") Exit For End If End if Next console.read () End Sub End Module

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.