Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Gad Report-1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

SR NO TOPIC PAGE NO

1 FRONT FAGE
2 CERTIFICATE
3 ACTION PLAN
4 INDEX
5 CODE AND
OUTPUT
6 ABSTRACT
7 INTRODUCTION

8 CONCLUSION

9 RESULT
10 REFERENCE

INDEX
ABSTRACT
• This presents the development of a softwarebased
scientific calculator using Visual Basic.Net (VB.Net).
Visual Studio 2022 package was used and it contains
the VB.Net framework.

• The calculator design was done in the visual “FORM”


environment of the VB .Net, while the control program
was written in “Form1.vb” by double clicking the
buttons on the Tic Tac Toe.

• The program ran and it was error-free. The Tic Tac Toe
was implemented in a Windows Operating System (OS)
because Visual Basic .Net is a Windows-based
software.

• Common Controls in VB.Net Used for the System


development

• Button: This is used to raise an event when a user


clicks on it. It is for writing most programs. Here, it was
used in the design of the “number buttons‟ like 1, 2, 3,
4, etc ,"label " .

• TextBox: To Display the points Between players


INTRODUCTION
• A Calculator is a small (often pocket-sized), usually
inexpensive electronic device used to perform the basic
operations of arithmetic.

• Modern calculators are more portable than most


computers, though most Palmtops are comparable in
size to handheld calculators .

• This software-based scientific calculator was


developed using Visual Studio. Visual Studio is an
Integrated Development Environment (IDE), providing a
single interface for any number of languages, including
Visual Basic.

CODE
Public Class Form1
Dim checker As Boolean

Dim plusone As Integer

Private lblPlayerX As Object

Private lblPlayerO As Object

Private btnNewgame As Object

Private Sub Enable_False()

btnTic1.Enabled = False

btnTic2.Enabled = False

btnTic3.Enabled = False

btnTic4.Enabled = False

btnTic5.Enabled = False

btnTic6.Enabled = False

btnTic7.Enabled = False

btnTic8.Enabled = False

btnTic9.Enabled = False

End Sub

Private Sub score()

If (btnTic1.Text = "X" And btnTic2.Text = "X" And btnTic3.Text = "X") Then

btnTic1.BackColor = System.Drawing.Color.PowderBlue

btnTic2.BackColor = System.Drawing.Color.PowderBlue

btnTic3.BackColor = System.Drawing.Color.PowderBlue

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic1.Text = "X" And btnTic4.Text = "X" And btnTic7.Text = "X") Then

btnTic1.BackColor = System.Drawing.Color.Pink
btnTic4.BackColor = System.Drawing.Color.Pink

btnTic7.BackColor = System.Drawing.Color.Pink

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic1.Text = "X" And btnTic5.Text = "X" And btnTic9.Text = "X") Then

btnTic1.BackColor = System.Drawing.Color.Crimson

btnTic5.BackColor = System.Drawing.Color.Crimson

btnTic9.BackColor = System.Drawing.Color.Crimson

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic3.Text = "X" And btnTic5.Text = "X" And btnTic7.Text = "X") Then

btnTic3.BackColor = System.Drawing.Color.CadetBlue

btnTic5.BackColor = System.Drawing.Color.CadetBlue

btnTic7.BackColor = System.Drawing.Color.CadetBlue

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic2.Text = "X" And btnTic5.Text = "X" And btnTic8.Text = "X") Then

btnTic2.BackColor = System.Drawing.Color.SlateBlue
btnTic5.BackColor = System.Drawing.Color.SlateBlue

btnTic8.BackColor = System.Drawing.Color.SlateBlue

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic3.Text = "X" And btnTic6.Text = "X" And btnTic9.Text = "X") Then

btnTic3.BackColor = System.Drawing.Color.Violet

btnTic6.BackColor = System.Drawing.Color.Violet

btnTic9.BackColor = System.Drawing.Color.Violet

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic4.Text = "X" And btnTic5.Text = "X" And btnTic6.Text = "X") Then

btnTic4.BackColor = System.Drawing.Color.DarkSlateBlue

btnTic5.BackColor = System.Drawing.Color.DarkSlateBlue

btnTic7.BackColor = System.Drawing.Color.DarkSlateBlue

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic7.Text = "X" And btnTic8.Text = "X" And btnTic9.Text = "X") Then

btnTic7.BackColor = System.Drawing.Color.Azure
btnTic8.BackColor = System.Drawing.Color.Azure

btnTic9.BackColor = System.Drawing.Color.Azure

MessageBox.Show("The Winner is Player X", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerX.Text)

lblPlayerX.text = Convert.ToString(plusone)

Enable_False()

End If

If (btnTic1.Text = "O" And btnTic2.Text = "O" And btnTic3.Text = "O") Then

btnTic1.BackColor = System.Drawing.Color.AliceBlue

btnTic2.BackColor = System.Drawing.Color.AliceBlue

btnTic3.BackColor = System.Drawing.Color.AliceBlue

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic1.Text = "O" And btnTic4.Text = "O" And btnTic7.Text = "O") Then

btnTic1.BackColor = System.Drawing.Color.LemonChiffon

btnTic4.BackColor = System.Drawing.Color.LemonChiffon

btnTic7.BackColor = System.Drawing.Color.LemonChiffon

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic1.Text = "O" And btnTic5.Text = "O" And btnTic9.Text = "O") Then

btnTic1.BackColor = System.Drawing.Color.BlueViolet
btnTic5.BackColor = System.Drawing.Color.BlueViolet

btnTic9.BackColor = System.Drawing.Color.BlueViolet

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic3.Text = "O" And btnTic5.Text = "O" And btnTic7.Text = "O") Then

btnTic3.BackColor = System.Drawing.Color.NavajoWhite

btnTic5.BackColor = System.Drawing.Color.NavajoWhite

btnTic7.BackColor = System.Drawing.Color.NavajoWhite

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic2.Text = "O" And btnTic5.Text = "O" And btnTic8.Text = "O") Then

btnTic2.BackColor = System.Drawing.Color.SandyBrown

btnTic5.BackColor = System.Drawing.Color.SandyBrown

btnTic8.BackColor = System.Drawing.Color.SandyBrown

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic3.Text = "O" And btnTic6.Text = "O" And btnTic9.Text = "O") Then

btnTic3.BackColor = System.Drawing.Color.SeaGreen
btnTic6.BackColor = System.Drawing.Color.SeaGreen

btnTic9.BackColor = System.Drawing.Color.SeaGreen

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic4.Text = "O" And btnTic5.Text = "O" And btnTic6.Text = "O") Then

btnTic4.BackColor = System.Drawing.Color.Azure

btnTic5.BackColor = System.Drawing.Color.Azure

btnTic7.BackColor = System.Drawing.Color.Azure

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

If (btnTic7.Text = "O" And btnTic8.Text = "O" And btnTic9.Text = "O") Then

btnTic7.BackColor = System.Drawing.Color.DarkBlue

btnTic8.BackColor = System.Drawing.Color.DarkBlue

btnTic9.BackColor = System.Drawing.Color.DarkBlue

MessageBox.Show("The Winner is Player O", "TicTacToe", MessageBoxButtons.OK,


MessageBoxIcon.Information)

plusone = Convert.ToInt64(lblPlayerO.Text)

lblPlayerO.text = Convert.ToString(plusone + 1)

Enable_False()

End If

End Sub

Private Sub Form1_load(sender As Object, e As EventArgs) Handles MyBase.Load


End Sub

Private Sub btnTic1_Click(sender As Object, e As EventArgs) Handles btnTic1.Click

If (checker = False) Then

btnTic1.Text = "X"

checker = True

Else

btnTic1.Text = "O"

checker = False

End If

score()

btnTic1.Enabled = False

End Sub

Private Sub btnTic2_Click(sender As Object, e As EventArgs) Handles btnTic2.Click

If (checker = False) Then

btnTic2.Text = "X"

checker = True

Else

btnTic2.Text = "O"

checker = False

End If

score()

btnTic2.Enabled = False

End Sub

Private Sub btnTic3_Click(sender As Object, e As EventArgs) Handles btnTic3.Click

If (checker = False) Then

btnTic3.Text = "X"

checker = True

Else
btnTic3.Text = "O"

checker = False

End If

score()

btnTic3.Enabled = False

End Sub

Private Sub btnTic4_Click(sender As Object, e As EventArgs) Handles btnTic4.Click

If (checker = False) Then

btnTic4.Text = "X"

checker = True

Else

btnTic4.Text = "O"

checker = False

End If

score()

btnTic4.Enabled = False

End Sub

Private Sub btnTic5_Click(sender As Object, e As EventArgs) Handles btnTic5.Click

If (checker = False) Then

btnTic5.Text = "X"

checker = True

Else

btnTic5.Text = "O"

checker = False

End If

score()

btnTic5.Enabled = False

End Sub

Private Sub btnTic6_Click(sender As Object, e As EventArgs) Handles btnTic6.Click


If (checker = False) Then

btnTic6.Text = "X"

checker = True

Else

btnTic6.Text = "O"

checker = False

End If

score()

btnTic6.Enabled = False

End Sub

Private Sub btnTic7_Click(sender As Object, e As EventArgs) Handles btnTic7.Click

If (checker = False) Then

btnTic7.Text = "X"

checker = True

Else

btnTic7.Text = "O"

checker = False

End If

score()

btnTic7.Enabled = False

End Sub

Private Sub btnTic8_Click(sender As Object, e As EventArgs) Handles btnTic8.Click

If (checker = False) Then

btnTic8.Text = "X"

checker = True

Else

btnTic8.Text = "O"

checker = False

End If

score()
btnTic8.Enabled = False

End Sub

Private Sub btnTic9_Click(sender As Object, e As EventArgs) Handles btnTic9.Click

If (checker = False) Then

btnTic9.Text = "X"

checker = True

Else

btnTic9.Text = "O"

checker = False

End If

score()

btnTic9.Enabled = False

End Sub

Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click

btnTic1.Enabled = True

btnTic2.Enabled = True

btnTic3.Enabled = True

btnTic4.Enabled = True

btnTic5.Enabled = True

btnTic6.Enabled = True

btnTic7.Enabled = True

btnTic8.Enabled = True

btnTic9.Enabled = True

btnTic1.Text = ""

btnTic2.Text = ""

btnTic3.Text = ""

btnTic4.Text = ""

btnTic5.Text = ""

btnTic6.Text = ""
btnTic7.Text = ""

btnTic8.Text = ""

btnTic9.Text = ""

lblPlayerX.text = "0"

lblPlayerO.text = "0"

btnTic1.BackColor = System.Drawing.Color.WhiteSmoke

btnTic2.BackColor = Color.WhiteSmoke

btnTic3.BackColor = Color.WhiteSmoke

btnTic4.BackColor = Color.WhiteSmoke

btnTic5.BackColor = Color.WhiteSmoke

btnTic6.BackColor = Color.WhiteSmoke

btnTic7.BackColor = Color.WhiteSmoke

btnTic8.BackColor = Color.WhiteSmoke

btnTic9.BackColor = Color.WhiteSmoke

End Sub

Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click

btnTic1.Enabled = True

btnTic2.Enabled = True

btnTic3.Enabled = True

btnTic4.Enabled = True

btnTic5.Enabled = True

btnTic6.Enabled = True

btnTic7.Enabled = True

btnTic8.Enabled = True

btnTic9.Enabled = True

btnTic1.Text = ""

btnTic2.Text = ""
btnTic3.Text = ""

btnTic4.Text = ""

btnTic5.Text = ""

btnTic6.Text = ""

btnTic7.Text = ""

btnTic8.Text = ""

btnTic9.Text = ""

btnNewgame.Enable = True

btnTic1.BackColor = System.Drawing.Color.WhiteSmoke

btnTic2.BackColor = Color.WhiteSmoke

btnTic3.BackColor = Color.WhiteSmoke

btnTic4.BackColor = Color.WhiteSmoke

btnTic5.BackColor = Color.WhiteSmoke

btnTic6.BackColor = Color.WhiteSmoke

btnTic7.BackColor = Color.WhiteSmoke

btnTic8.BackColor = Color.WhiteSmoke

btnTic9.BackColor = Color.WhiteSmoke

End Sub

Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click

Dim iExit As DialogResult

iExit = MessageBox.Show("Confirm if you want to exit", "TicTacToe", MessageBoxButtons.YesNo,


MessageBoxIcon.Question)

If iExit = DialogResult.Yes Then

Application.Exit()

End If

End Sub

End Class

OUTPUT
CONCLUSION
• With the introduction of the .Net framework and VB.Net
language, software development has been greatly
facilitated with easy use of objects (forms, buttons,
boxes, etc) which can be inserted and then their
functions specified by coding.

• This paper has succeeded in giving an insight into the


Microsoft‟s .Net framework and that of Visual Basic
Programming language; and the use of the language in
the software development of a Software-based Simple
game.

• Other software-based calculating systems like Visual


loan calculator, weather forecast analysing software,
etc, can as well be designed using VB.Net.

RESULT
Thus we have completed the Microproject successfully

REFERENCE
• https://youtu.be/s5xhTZhWhrQ

You might also like