IJERTV1IS10076
IJERTV1IS10076
ISSN: 2278-0181
Vol. 1 Issue 10, December- 2012
error-free. The Scientific calculator was implemented calculator was developed in the “FORM”
in a Windows Operating System (OS) because Visual environment of the Visual Studio; while the control
Basic .Net is a Windows-based software. program was written by double clicking the buttons
in the “Form 1.vb.
Keywords: Visual Basic .NET, scientific There are two major classes of operating tools for
calculator, label and toolbox. software development using Visual Basic .Net [4].
They are the Toolbox and the Properties. Toolbox is
grouped into classes, namely; All Windows Form,
1. Introduction Common Controls, Containers, Menus & Toolbars,
Data, Components, Printing, Dialogs, WPF
A Calculator is a small (often pocket-sized), usually Interoperability, Reporting, and General. While
inexpensive electronic device used to perform the Properties have Accessibility, Appearance, Behavior,
basic operations of arithmetic. Modern calculators are Data, Design, Focus, Layout, Misc, and Window
more portable than most computers, though most Style [5].
Palmtops are comparable in size to handheld
calculators [1]. 2. The System Development
This software-based scientific calculator was
developed using Visual Studio. Visual Studio is an To develop this calculator, open Visual Studio 2008,
Integrated Development Environment (IDE), and create the new design in the „FORM‟
providing a single interface for any number of environment. Note the needed information, like the
languages, including Visual Basic. The purpose of an names that will be given to the various buttons and
IDE is to combine the editing, debugging, and the Label for information display. In order to open
compiling components of software development into the environment for system development, the
a single interface for a programmer [2]. following steps are to be taken:
www.ijert.org 1
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 1 Issue 10, December- 2012
RRTT
Fig. 1. A Visual Studio design interface containing the “FORM”
IIJJEE
4) Start the proper design by positioning the Label for Label: It provides run-time information or descriptive
display and the buttons as keys. These are known as text for a control. It is used for writing or labelling
Controls, and are kept in the Toolbox for ease of use. items in the form environment. If this control is used,
The Toolbox can be found on the left hand side of the data on it cannot be tampered because it has no
screen. cursor inside it, unlike the Textbox [7]. It was used in
To display all the tools, move the mouse over the this work for designing the „screen area‟ for the
Toolbox icon. There are seven categories of tools display of the numbers pressed and the mathematical
available. The Toolbox to be working with first is the operation together with the result of any calculation.
Common Controls Toolbox. To see the tools, click on
the plus symbol next to Common Controls. 2.2. Design procedure for the Scientific
calculator
2.1. Common Controls in VB.Net Used for the
System development 1) Drag the needed buttons from the ToolBox and
drop them inside the “FORM”.
Button: This is used to raise an event when a user 2) Copy and paste the buttons to the corresponding
clicks on it. It is for writing most programs. Here, it number of numeric buttons and Math functions
was used in the design of the „number buttons‟ like 1, buttons that are needed.
2, 3, 4, etc and „mathematical functions buttons‟ like On the right hand side of the design environment,
/, -, +, x, etc. there are Properties box. This is the area that controls
the design “FORM”. The Properties Box of the
TextBox: It enables the user to enter text, and Visual Studio is shown in figure 2.
provides multiline editing and password character Click on each button and at the Properties box,
masking [6]. Cursor can be placed here. It was not change the names of the buttons in the “Text”
used in this work. Properties to 0,1,2,3,4,5,6,7,8,9,sin,/,+,-. log, cos, tan,
sqr, etc.
www.ijert.org 2
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 1 Issue 10, December- 2012
3) Also click on the Math function buttons and 5) When any of the buttons is double clicked, it takes
likewise change their names at the “Text” Properties one to the code area from where one writes the code
to +, -, *, /, etc. that defines the function of that button.
4) Drag “Label” from the Toolbox and it drop inside The layout design is called the form 1.vb (design),
the FORM. This is used for the display of shown in figure 3.
information.
RRTT
IIJJEE
www.ijert.org 3
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 1 Issue 10, December- 2012
4. Conclusion End If
With the introduction of the .Net framework and cleardisplay = False
VB.Net language, software development has been lblDisplay.Text = lblDisplay.Text + sender.text
End Sub
RRTT
greatly facilitated with easy use of objects (forms,
buttons, boxes, etc) which can be inserted and then Private Sub btnCancel_Click(ByVal sender As
their functions specified by coding. System.Object, ByVal e As System.EventArgs)
This paper has succeeded in giving an insight into the Handles btnCancel.Click
IIJJEE
Microsoft‟s .Net framework and that of Visual Basic lblDisplay.Text = " "
Programming language; and the use of the language End Sub
in the software development of a Software-based Private Sub btnplus_Click(ByVal sender As
Scientific calculator. Other software-based System.Object, ByVal e As System.EventArgs)
calculating systems like Visual loan calculator, Handles btnplus.Click
weather forecast analysing software, etc, can as well Operand1 = Val(lblDisplay.Text)
be designed using VB.Net. Operators = "+"
cleardisplay = True
5. The Developed Software (Program) End Sub
Private Sub btnminus_Click(ByVal sender As
Imports System.Math System.Object, ByVal e As System.EventArgs)
Public Class Form1 Handles btnminus.Click
Dim Operand1, Operand2, ans As Double Operand1 = Val(lblDisplay.Text)
Dim Operators As String Operators = "-"
Dim cleardisplay As Boolean cleardisplay = True
Private Sub Form1_Load(ByVal sender As End Sub
System.Object, ByVal e As System.EventArgs) Private Sub btndiv_Click(ByVal sender As
Handles MyBase.Load System.Object, ByVal e As System.EventArgs)
End Sub Handles btndiv.Click
Private Sub btn1_Click(ByVal sender As Operand1 = Val(lblDisplay.Text)
System.Object, ByVal e As System.EventArgs) Operators = "/"
Handles btn1.Click, btn0.Click, btn2.Click, cleardisplay = True
btn3.Click, btn4.Click, btn5.Click, btn6.Click, End Sub
btn7.Click, btn8.Click, btn9.Click Private Sub btnmul_Click(ByVal sender As
If cleardisplay Then System.Object, ByVal e As System.EventArgs)
lblDisplay.Text = " " Handles btnmul.Click
Operand1 = Val(lblDisplay.Text)
www.ijert.org 4
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 1 Issue 10, December- 2012
www.ijert.org 5