Академический Документы
Профессиональный Документы
Культура Документы
NET
APIIT SD INDIA
Page 1
CERTIFICATE
This is to certify that Mr. Raju Ranjan of 4th Semester student (Computing Branch) of APIIT SD INDIA have successfully completed his individual assignment named of V B .net on Tasks 4 , 4 , 6 under the sheer guidance of Ms. Sakshi Popli.
APIIT SD INDIA
Page 2
TABLE OF CONTEXT
Acknowledgement..4 Task 4.5 Introduction Objective Planning Design.6 Implementation...7 Testing....8 Task 12 Introduction Objective Planning Design..13 Implementation.14 Testing..16 Task 17 Introduction Objective
ACKNOWLEDGEMENT
This project is provided to make .net application. I give my full regards for providing the opportunity to make Visual Basic .net, Ms.Sakshi Popli who had continually helped and motivated us to complete the assignment. It was really a wonderful experience for me to work under such a dynamic and helping personality. She gave us the knowledge of each & everything related and beyond the module in order to enhance our skills and this assignment has been made possible due to her expertise and knowledge. Last and but not the least, I want to acknowledge all my friends and colleagues who supported me in my assignment.
APIIT SD INDIA
Page 4
Objective: use radio buttons to provide choices use panels to group options generate random numbers use select statement to determine which country has been selected display image in picture box use if statement to check whether answer is correct use methods and parameters to avoid code repetition
Planning: Firstly I plan to create a form and specify the name and then declare all the variables. I plan to take the same and small size of flag so that it looks better in picture box. Then I think to generate random number and used to select the name of a country which is then stored in a variable. Then I plan how to use select statement to determine which country has been selected. Then I plan to use if statement to check whether answer is correct. Then I enabled all available country options so that the user can select the one they think is correct, and the Flag button is disabled. I plan to display Correct message when correct country selected. And also plan to show Incorrect message when wrong country selected. I plan to use Single method to avoid repetition of code.
APIIT SD INDIA
Page 5
Design:-
Flag Button
Picture Box
Radio Button
Lable
APIIT SD INDIA
Page 6
Object Form1 Label1 RadioButton1 RaioButton2 RadioButton3 RadiButton4 RadioButton5 RadioButton6 RadioButton7 Button
Property Name Text Name Text Name Text Name Text Name Text Name Text Name Text Name Text Name Text Name Text
Value Frmflag Identify Flags lblMessage btnBelgium Belgium btnCanada Canada btnChina China btnFinland Finland btnFrance France btnSudan Sudan btnZambia Zambia btnFlag Flag
Implementation:#Region "Identify flags" Public Class Form1 Dim country As String Dim randomnum As Integer Dim randum As New Random #Region "disabler function" Public Sub disabler() radiobutton rdbCanada.Enabled = True rdbBelgium.Enabled = True rdbChina.Enabled = True rdbFinland.Enabled = True rdbSudan.Enabled = True rdbZambia.Enabled = True rdbFrance.Enabled = True End Sub #End Region #Region "form load" 'declear country as string variable 'declear randomnum as integer 'declear randum as Randum 'declear a function for disabeling the 'make 'make 'make 'make 'make 'make 'make radio radio radio radio radio radio radio button button button button button button button disabled disabled disabled disabled disabled disabled disabled
APIIT SD INDIA
Page 7
Case 1 picFlag.Image = Image.FromFile("belgium-flag-1.png") country = "Belgium" 'country variable store the value of Belgium Case 2 picFlag.Image = Image.FromFile("Canada-Flag.png") country = "Canada" 'country variable store the value of Case 3 picFlag.Image = Image.FromFile("China-Flag-icon250x250.png") country = "China" 'country variable store the value of China Case 4 picFlag.Image = Image.FromFile("finland-flag-1.png") country = "Finland" 'country variable store the value of Finland Case 5 picFlag.Image = Image.FromFile("france.png") country = "France" 'country variable store the value of France Case 6 picFlag.Image = Image.FromFile("Sudan.png") country = "Sudan" 'country variable store the value of Sudan Case 7 picFlag.Image = Image.FromFile("Zambia.png") country = "Zambia" 'country variable store the value of Zambia pnlconty.Enabled = True End Select
APIIT SD INDIA
Page 8
APIIT SD INDIA
Page 9
Private Sub rdbZambia_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdbZambia.CheckedChanged If country = "Zambia" Then lblMessage.Text = " Answer is correct" Else lblMessage.Text = " Answer is incorrect" End If pnlconty.Enabled = False event of radio button rdbZambia.Checked = False btnFlag.Enabled = True event of radio button End Sub #End Region End Class #End Region 'panel is disabled after the click 'it unchecked the radio button 'flag button is enabled after click
APIIT SD INDIA
Page 10
APIIT SD INDIA
Page 11
Objective: identify attributes identify properties identify methods draw class diagram implement enumerated types implement private data implement properties implement constructor method implement additional methods
Planning: Firstly I plan to create a form and specify the form name and then declare all the variables. Then I plan to create car through coordinate by the help of graphics. I plan to specify its location, width, height, distance and its colour. Also plan to provide Enum to fix the value of variable. Plan to set the direction to left and move the car using the moveCar method Plan to set the direction to right and move the car using the moveCar method The left and right buttons must be disabled until the car has been created.
APIIT SD INDIA
Page 12
picRoad
APIIT SD INDIA
Page 13
Property Name Text Name Text Name Text Name Text Name Text
Value frmcar Test car btnCreate Create btnLeft Left btnRight Right picRoad
#Region "Class car" Public Class Car 'declear a graphics variable Dim k As Graphics Public draw As carmove 'declear a public type variable Dim car1 As New CarClass 'create a object car1 of carclass Dim x As Integer 'declear a variable Dim y As Integer 'declear a variable Dim a As Integer 'declear a variable #Region "Enum" Public Enum carmove As Integer 'create a Enum left = 1 right = 2 End Enum #End Region #Region "form load" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' btnCreate.Text = "Create" 'write a text in label btnLeft.Text = "Left" 'write a text in label btnRight.Text = "Right" 'write a text in label End Sub #End Region
APIIT SD INDIA
Page 14
APIIT SD INDIA
Page 15
'call 'use
Testing:Project Title Test Case Name Test Case ID Conducted By Description Testing Type Duration Car class Car class 2 Raju Ranjan A Car class is required to model cars Unit testing 2 day Testing Date 28/3/12
APIIT SD INDIA
Page 16
LEARNING OUTCOME:We learned that to add forms to project, change form names and start up form .Also learned to change start position of form and remove control box from form. How to add module to project to declare Public variables .We also learned to create new form objects at runtime, show forms at runtime, hide forms at runtime, close forms at runtime and show forms as dialogs runtime.
APIIT SD INDIA
Page 17
Planning: Firstly I plan to create a form and specify the form name and then declare all the variables. Then I plan to add forms to project and change the form names I plan to remove control box from form and add code module to project to declare public variables. I plan to create new form objects at run time I plan to show, hide ,close forms at runtime I plan to show forms as dialogs at runtime I plan to enable the Task button and disable Back button initially on each task screen. I plan to disable the Task button and enabled Back button on completing each task screen. I plan to enable the Task button and disable Back button on failing to complet each task screen. I plan to show and hide Forms correctly. 4 Background of each form set to selected colour.
APIIT SD INDIA
Page 18
Spike
Flags
Car
ToolStrip (Toolbar)
MenuStrip
APIIT SD INDIA
Page 19
Introduction to Visual Basic .NET Implementation:#Region "Class Link" Public Class link #Region "Form load" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.ControlBox = False 'make the control box disabled End Sub #End Region #Region "ToolStrip Button1" Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click Dim mdichild As New spike 'create a object mdichild of form Spike mdichild.MdiParent = Me 'set it to MdiParent of mdichild form mdichild.Show() 'display the new form End Sub #End Region #Region "Tool Strip Button2" Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click Dim mdichild As New flag 'create a object mdichild of form flag mdichild.MdiParent = Me 'set it to MdiParent of mdichild form mdichild.Show() 'display the new form End Sub #End Region #Region "Tool Strip1" Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked Dim mdichild As New Form 'create a object mdichild of form Test car mdichild.MdiParent = Me 'set it to MdiParent of mdichild form mdichild.Show() 'display the new form End Sub #End Region #Region "ToolStripButton3" Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click Dim mdichild As New Form 'create a object mdichild of form Test car mdichild.MdiParent = Me 'set it to MdiParent of mdichild form mdichild.Show() 'display the new form End Sub #End Region #Region "ToolStripMenuItem" Private Sub CreateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateToolStripMenuItem.Click
APIIT SD INDIA
Page 20
MODULE CODE:Module Module1 Dim O As New Form1 Public Sub main() O.ShowDialog() End Sub End Module
APIIT SD INDIA
Page 21
APIIT SD INDIA
Page 22
APIIT SD INDIA
Page 23
APIIT SD INDIA
Page 24
Introduction to Visual Basic .NET REFERENCES 1. Radio Button Events in VB.Net (No author) This website available at http://www.programmersheaven.com/mb/VBNET/339353/339353/ra dio-button-events/ Last accessed on 25th March. 2012(Time: 2:30 pm) 2. An Introduction to Programming Using Visual Basic .net (5th edition) by David I. Schneider
APIIT SD INDIA
Page 25