0% found this document useful (0 votes)
62 views9 pages

Component C: Takunda Mutombwera

The document describes designing a calculator application for a manufacturing company called Sentam Trade. It includes: 1) An algorithm for the calculator using a switch case structure to perform basic arithmetic operations like addition, subtraction, multiplication and division. 2) The interface of the calculator application containing number buttons, arithmetic operator buttons and an equals button. 3) The code listing in Visual Basic for the calculator application implementing the interface and algorithm described. It includes code handling number and operator button clicks to update the display and calculate results.

Uploaded by

Pride Nyamadzawo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views9 pages

Component C: Takunda Mutombwera

The document describes designing a calculator application for a manufacturing company called Sentam Trade. It includes: 1) An algorithm for the calculator using a switch case structure to perform basic arithmetic operations like addition, subtraction, multiplication and division. 2) The interface of the calculator application containing number buttons, arithmetic operator buttons and an equals button. 3) The code listing in Visual Basic for the calculator application implementing the interface and algorithm described. It includes code handling number and operator button clicks to update the display and calculate results.

Uploaded by

Pride Nyamadzawo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

TAKUNDA

COMPONENT C
MUTOMBWERA

Learning Area: A Level COMPUTER SCIENCES

Candidate Name: TAKUNDA MUTOMBWERA

Candidate Number: 050436

Centre Name NASHVILLE HIGH SCHOOL

Centre Number: 5009

CALA Type : Practical

Level: Form Six

Topic : SYSTEM ANALYSIS AND DESIGN

Title: DESIGNING A CALCULATOR

Littleman
[COMPANY NAME]
Background

In your community, there are areas where calculators are still manually done

Concepts /Skills

1. Research

2. Problem-solving

3. Design

4. Develop

5. Testing

CALA Description

Part a
o Carry a research on an area which performs some calculations in your
community
o Write down the algorithm for arithmetic operations

Part b
o Design the interface of the calculator using the tools organised in A
o Convert the algorithm for arithmetic operations to your programming
language of choice
o Test the programs and take screen shots
PART A

Sentam Trade is a manufacturing company which is located in Mkoba 13


Gweru.it is about 25 km from Gweru CBD. The company was found by Farai
Makamure in September 2017.it manufactures goods such as detergent, dish
wash, soap and sanitizer. The company uses a manual system in calculating
their sales which is time consuming.

Proposed new system

The researcher is wishing to introduce a computerized system of a calculator to


your company which will makes it easier for the company to calculate its sales.
The new system will be able to add, subtract, multiply and divide and giving an
accurate result of the calculation. The new system will also allow you to clear
the old values which you might no longer need if you want to calculate new
values.

Justification to the new system

The system is user friendly, it cut time and have few stages in performing the
task. The user do not need to consult user manual all time when using the
system. It is faster in performance for example processing and displaying the
results
Algorithm of calculator using switch case:
o Begin

 Print "Enter your choice"

o Enter your choice

o Enter two operands

o If the user enters + or - or * or / then follow the below steps

 else flow goes to default case & exit the program

 Switch(operator)

Case +:

 Print ‘Addition’.

 Print result of summation.

 break

Case -:

 Print ‘Subtraction’.

 Print result of subtraction.

 break

Case *:

 Print ‘Multiplication’.

 Print result of multiplication.

 break

Case /:

 Print ‘Division’.

 Print result of division.

 break

Default:

 Print ‘Invalid Option


PART B

INTERFACE

CALCULATOR

DEL

1 2 3 +

4 5 6 -

7 8 9 /

. 0 = *
CODE LISTING
Public Class Form1

Private Sub Button17_Click(sender As Object, e As EventArgs) Handles


btnopclear.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopclear" Then
Textbox1.Text = ""
End If
End Sub

Private Sub Button9_Click(sender As Object, e As EventArgs) Handles btn9.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn9" Then
Textbox1.Text = Textbox1.Text & 9

End If

End Sub

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


Dim button As Button = CType(sender, Button)
If button.Name = "btn0" Then
Textbox1.Text = Textbox1.Text & 0
End If
End Sub

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


btnopdot.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopdot" Then
Textbox1.Text = Textbox1.Text & "."
End If
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles btn5.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn5" Then
Textbox1.Text = Textbox1.Text & 5
End If
End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles btn6.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn6" Then
Textbox1.Text = Textbox1.Text & 6
End If
End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles btn7.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn7" Then
Textbox1.Text = Textbox1.Text & 7
End If
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Btn1.Click


Dim button As Button = CType(sender, Button)
If button.Name = "Btn1" Then
Textbox1.Text = Textbox1.Text & 1
End If
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btn2.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn2" Then
Textbox1.Text = Textbox1.Text & 2
End If
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles btn3.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn3" Then
Textbox1.Text = Textbox1.Text & 3
End If
End Sub

Private Sub Button14_Click(sender As Object, e As EventArgs) Handles


btnopminus.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopminus" Then
Textbox1.Text = Textbox1.Text & "-"
End If
End Sub

Private Sub Button13_Click(sender As Object, e As EventArgs) Handles


btnopadd.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopadd" Then
Textbox1.Text = Textbox1.Text & "+"
End If
End Sub

Private Sub Button15_Click(sender As Object, e As EventArgs) Handles


btnopdivide.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopdivide" Then
Textbox1.Text = Textbox1.Text & "/"
End If
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles btn4.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn4" Then
Textbox1.Text = Textbox1.Text & 4
End If
End Sub

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles btn8.Click


Dim button As Button = CType(sender, Button)
If button.Name = "btn8" Then
Textbox1.Text = Textbox1.Text & 8
End If
End Sub

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


btnopequals.Click
Dim button As Button = CType(sender, Button)
Dim equation As String = Textbox1.Text
Dim results = New DataTable().Compute(equation, Nothing)
If button.Name = "btnopequals" Then
Textbox1.Text = results
End If
End Sub

Private Sub Button16_Click(sender As Object, e As EventArgs) Handles


btnopmultiply.Click
Dim button As Button = CType(sender, Button)
If button.Name = "btnopmultiply" Then
Textbox1.Text = Textbox1.Text & "*"
End If
End Sub

Private Sub Textbox1_TextChanged(sender As Object, e As EventArgs) Handles


Textbox1.TextChanged

End Sub

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

End Sub
End Class

You might also like