Unit 12 - Assignment 3
Unit 12 - Assignment 3
UNIT 12 ASSINGMENT
3
UTC READING
Contents
.......................................................................................................................................... 0
Introduction....................................................................................................................... 2
User requirements.......................................................................................................... 2
Purpose and audience..................................................................................................... 2
Problem definition statement.......................................................................................... 2
Documented code.............................................................................................................. 3
User interface/solution....................................................................................................... 5
.......................................................................................................................................... 5
.......................................................................................................................................... 5
.......................................................................................................................................... 7
.......................................................................................................................................... 8
Construct/techniques used................................................................................................ 9
Dim................................................................................................................................. 9
If statements................................................................................................................... 9
Subroutines/Event handling............................................................................................ 9
Maths operators.............................................................................................................. 9
Test plan........................................................................................................................... 10
........................................................................................................................................ 10
........................................................................................................................................ 10
........................................................................................................................................ 11
........................................................................................................................................ 11
........................................................................................................................................ 11
Debugging....................................................................................................................... 12
Questionnaire................................................................................................................... 13
Questionnaire response................................................................................................... 14
Conclusion....................................................................................................................... 14
Bibliography..................................................................................................................... 15
Introduction
For this assignment we were given this scenario; The manager in
charge of the currency exchange of the local HSBC bank likes your
solution for the currency convertor (assignment 2). That manager has
asked you to develop your program solution, requiring you to structure
your approach for maintainability, by including a commentary within the
code. You will need to test the program against a test plan of your own
devising, checking that the clients requirements are still being met and
documenting any changes that you have made to the program since the
previous assignment. Be sure to fix any faults in the program as you
work from design to implementation.
You will then need to get feedback on the program from one other
person, including how easy it is to use and the quality of the code.
Review and refine your program in the light of that feedback.
This needs to be fully documented.
User requirements
The user requirements for this software are as follows
User friendly
Aesthetically pleasing
These are the basic user requirements for the software.
Documented code
The following is the code that I have come up with so far for this assignment;
Public Class Form1
'This part of the code is being used to declare integers'
Dim exchangerate As Double
Dim Result As Double
Dim Amount As Decimal
'This is controling what the buttons do and it is also '
Private Sub CalculateBtn_Click(sender As Object, e As EventArgs) Handles
CalculateBtn.Click
If IsNumeric(TextBox1.Text) Then
Else
MsgBox("You must insert a number.")
GoTo end1
End If
'This is giving the text box a name'
Amount = TextBox1.Text
'The following lines of code are all if statements. These are all being used to convert one
currency to another. An error message will also pop-up if the user has not sel'
If Dollar.Checked = True And Dollar1.Checked = True Then
MsgBox("You must select two different currencies.")
End If
If Dollar.Checked = True And Pound1.Checked = True Then
exchangerate = 0.6763
End If
If Dollar.Checked = True And Yen1.Checked = True Then
exchangerate = 119.69
End If
If Dollar.Checked = True And Euro1.Checked = True Then
exchangerate = 0.9304
End If
I did get some help making this code and I will link the video that I used in
the bibliography.
User interface/solution
For this assignment I has to produce a Visual Basic project as well. I have not
finished my design because I had problems with VB during the holidays however
this is what I have done. On my final design a HSBC logo will be included as well
has
the
they
to.
Construct/techniques used
Dim
To declare the variables as a data type I used Dim. This allows me to
declare a storage space for a variable.
Dim exchangerate As Double
Dim Result As Double
Dim Amount As Decimal
If statements
These are lines of code that sort the storage space for the variables. In
this program I used if statements as the main form of converting the
currencies.
If Euro.Checked = True And Dollar1.Checked = True Then
exchangerate = 1.0751
End If
If Euro.Checked = True And Pound1.Checked = True Then
exchangerate = 0.727
End If
If Euro.Checked = True And Yen1.Checked = True Then
exchangerate = 128.81
End If
If Euro.Checked = True And Euro1.Checked = True Then
MsgBox("You must select two different currencies.")
End If
Subroutines/Event handling
Event handling is when the program detects an event that may be
handled by the program.
Private Sub CalculateBtn_Click(sender As Object, e As EventArgs) Handles
CalculateBtn.Click
The event that is being handled in this case is the calculate button. This
line of code processes the event of the button being clicked.
Maths operators
Maths operators are used to calculate mathematical calculations.
Result = exchangerate * Amount
Test plan
Test
Does the
program
open?
Does the
program
allow the
user
to
input
a
number?
Date
of
test
Test
descriptio
n
In this test
we
are
seeing if
the
program
will open
without
any issues
or faults.
Data
used
Expected
result
N/A
In this test
we are
seeing if
the
program
will allow
the user
to input a
number
into the
program
78
The
program
should
open
successfull
y without
an
issue
when
I
click
the
start
button.
The
program
should
allow the
user to
successfull
y input a
number
without an
issues
Actual result
The
program
opened
Currency
selection
In this test
we will
see if the
program
allows
The
program
should
allow the
user to
select two
different
currencies
.
Does the
currency
output the
correct
result
The
purpose is
to see if
the
program
outputs
the
correct
converted
amount.
Import
button
In this test
we will be
seeing if
the import
button
works
The
program
should
convert
the
currency
correctly
and
output the
right
amount.
The
import
feature
should run
without
any
issues.
Export
button
In this test
we will be
seeing if
the export
button
works
The export
feature
should run
without
any
issues.
Error
message
In this test
we will be
seeing if
the
program
pops up
with an
error
message
when the
user
doesnt
enter a
An error
message
should
pop up if
the user
doesnt
enter a
number.
number in
Debugging
In this screenshot we can see that Visual Basics has identified an error
that needs to be solved.
When I clicked on the error button Visual basics highlighted the error then
showed an options screen which allows you to select what method you
want to choose to debug your program. This is very useful as I can quickly
remove any bugs within my program and make it run smoothly again.
I havent made many code changes however the only thing that I have
done is change the names of my variables so that they are more suited to
the function.
If Euro.Checked = True And Pound1.Checked = True Then
exchangerate = 0.727
End If
Questionnaire
To fully test whether or not my program meets the user requirements I
have devised a questionnaire for users to answer.
(Filled out by Asma Butt and Elizabeth Perroud)
Is my program easy to use?
Yes I found he program very easy to use. It was very straight forward and
the layout is very simple which helps.
Did you have any difficulty whilst using it?
No I didnt experience any difficulties whilst using the program. It ran
smoothly and didnt take too long to process my transactions.
How well do you think the program has been designed?
I like the design of the program. I think that its very good because it suits
the general theme of HSBC. The logo has also been included which is
good.
Do you think that the program that I have created fulfils the user
requirements?
All of the functions that were included in the user requirements have been
fulfilled which means yes it does fulfil the user requirements.
Does the program accurately convert the currencies?
Yes it does, there were no inaccurate answers that were outputted.
Has it crashed whilst you used it and if so did it appear with an error
message?
It did crash once however an error message appeared which was very
useful because it means that I know what is going on whilst the program
crashes.
Do the import and export functions work?
Yes they do.
Questionnaire response
From the questionnaire I learnt that my program suits the user
requirements. This means that there is not many improvements that I can
make to my program however I will continue to edit it to make sure it runs
smoothly and I will also make sure to create an instruction guide for new
users.
Quality of code
Efficiency/performa
nce
Maintainability
Portability
Reliability
Robustness
Usability
Refinements
In my feedback I learnt that my program should have a user guide so that
any new users will understand how to use it. For my refinements I have
made sure to now include this. I also think that I could make my program
more aesthetically pleasing so that the design is better and better suited.
Conclusion
In conclusion I have created a program which converts currencies. This
program has many unique features such as an import and export
function which allows you to import and export previous conversions. My
app has also been designed with the user in mind. This means that I have
made sure to create an app which suits the user requirements and the
individual needs of the user. I have made sure to keep my program simple
and basic so that it is easy to use and does not crash.
Bibliography
http://www.google.co.uk/search?
q=hsbc+world+map+logo&safe=active&es_sm=93&source=lnms&tbm=isch&sa=X&ei=
ZWQBVZVag69p5fiCsA8&ved=0CAcQ_AUoAQ&biw=944&bih=951&surl=1#imgdii=_&im
grc=ZMOHVRCgH_XtwM%253A%3Bx-X4w8A8v35BZM%3Bhttp%253A%252F
%252Fwww.faqability.com%252Fwp-content%252Fuploads
%252F2013%252F07%252FHSBC3.jpg%3Bhttp%253A%252F%252Fwww.faqability.com
%252F%253Fproject%253Dhsbc-butterfly%3B800%3B479 HSBC world bank logo