1.Design and develop programs including internet programs deploying visual basic Net applications.
2.Implement user interfaces with relation to object orientated programming techniques and use classes and assemblies to make code reusable and extendable.
3.Use visual tools ADO.NET objects and basic Structured Query language to access and manipulate data.
Answers:
Introduction
In this assignment, I implemented the two scenarios-
Digital and Analog Clock
Count the number of words in a given textbox
I learned so many things while implementing the both scenarios e.g. mage the analog clock by graphics provided in visual studio. I imported the Drawing namespace to create the analog clock. I learned so many graphic features like draw line, draw image etc.
And in second scenario “Count the number of words in a given textbox”, I learned the regular expression very easily. It is the best way to count the number of words in the textbox or in a string.
Software Development Process
The first scenario- “Digital and Analog Clock”, is built like below-
Analog Clock
![]()
Digital Clock
![]()
If the user clicks on the Digital radio button, the digital clock will be displayed and if the user clicks on the Analog radio button, the analog clock will be displayed. By default Analog radio button is selected and it is done by following code in form load-
rdAnalog.Checked = True
If rdDigital.Checked = True Then
Me.Text = "Digital Clock"
Else
Me.Text = "Analog Clock"
End If
The digital clock is built by the e.Graphics.DrawString() method.
I tested the digital clock by taking different colour etc. like below-
e.Graphics.DrawString(String, ClockFont, Brushes.Blue, 150, 210)
![]()
(HScripts.com. 2017)
(Sourcecodester.com. 2017)
The analog clock is built by different methods of graphics like below-
- Graphics.DrawImage()
- Graphics.DrawLine()
- Graphics.FillEllipse()
The Second scenario- “Count the number of words in a given textbox”, is built like below-
![]()
The counting of words written in the given textbox is being done by the regular expression. The regular expression engine in the .Net is very powerful. It can be used in the text that have some pattern and the text that have not any similarity.
The Meta character “b” is used in the regular expression. The following way is used to calculate the total number of words in a given textbox-
RegularExpression.Matches (TextBox1.Text).Count / 2
(Goyvaerts, J. 2017)
(W3schools.com. 2017)
I learned so many thing while implementing the both scenarios. In making analog clock I learned so many graphic features e.g. creating a pen of different colour to show different colour in the clock e.g.
Dim Pen As Pen = New Pen (Color.Green, 3)
This can be used to draw lines etc. with this pen.
The time will be set in the clock by the following code in the Tick event of timer-
SecondAng = ( Now.Second * 6 )
MinuteAng = ( Now.Minute + Now.Second / 60 ) * 6
HourAng = ( Now.Hour + Now.Minute / 60 ) * 30
The form name was not changing when the radio button selection gets changed. Therefore, following code is sued for proper functionality-
Private Sub rdDigital_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdDigital.CheckedChanged
If rdDigital.Checked = True Then
Me.Text = "Digital Clock"
Else
Me.Text = "Analog Clock"
End If
End Sub
Self-Reflection
There are lots of things which I learned while implementing the “Digital and Analog Clock” and “Count the number of words in a given textbox” scenarios. Following most important features are as follows-
- Learned the Graphics features of Visual Studio .Net
- Learned the mathematical functions
- Learned the timer functionality
- Learned the features of drawing to make ellipse, lines etc. with different colours.
- Learned different events and properties of different controls in the visual studio.
- Learned regular expressions in visual studio.
In this way, I’ve learned lots of important things which are very useful to make an application independently. Every features is very interesting and useful.
Conclusion
The report is briefing the complete functionality implemented in the assignment. Both scenarios are being described in the report above. The best part of the assignment is the analog clock that is created by using the Drawing namespace. It is the best way to make the analog clock in spite of referencing the .dll from outside.
It helps me to understand the graphics features and now I am very confident in making different types of projects independently. The report will help others too to understand the vast features and functionality of the visual studio.
References
Goyvaerts, J. (2017). Word Boundaries. Available: https://www.regular-expressions.info/wordboundaries.html. [Accessed: 28-July-2017]
W3schools.com. (2017). JavaScript RegExp b Metacharacter. Available: https://www.w3schools.com/jsref/jsref_regexp_begin.asp. [Accessed: 28-July-2017]
HScripts.com. (2017). Create Digital Clock in VB.Net. Available: https://www.hscripts.com/tutorials/vbnet/digitalclock-project.html. [Accessed: 28-July-2017]
Sourcecodester.com. (2017). Displaying Digital and Analog Clock in VB.Net. Available: https://www.sourcecodester.com/tutorials/visual-basic-net/9169/displaying-digital-and-analog-clock-vbnet.html. [Accessed: 28-July-2017]