Vous êtes sur la page 1sur 20

CHANDINI DUDHNATH

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

Should have at least 4 currency types

Correctly calculate the exchanged amount between any of the


currencies

Export function to record all currency exchanges

Import function to read previously exported exchanges

User friendly

Aesthetically pleasing
These are the basic user requirements for the software.

Purpose and audience


The purpose of this software is to exchange one currency to another
(currency exchanger). This means it can be used by people going on
holiday to exchange the currency to the currency of the destination that
they are going to. It can also be used by businesses.

Problem definition statement


The problem definition statement for this assignment would be whatever
potential problem the user is coming across and how this can be fixed.
Currently there is no code to this currency exchanger meaning that it does
not work.
Physically, currency converters dont always look aesthetically pleasing.
This an instantly turns users and puts them of using the program. An

interface which looks appealing enhances the general user experience. It


also makes the program look more professional.
There should be multiple currencies which the user can convert from. This
in turn enhances the user experience making it useful for a wider range of
people.
Exchange rates also change frequently so it is important that can be
easily adapted. If it is hard to adapt the currency converter becomes
inaccurate and proves useless to the user. The easiest way to fix this
problem is make sure that the program updates with the internet this way
the exchange rates are still current.
Programs like this can often crash a lot as there is a lot of processes being
functions so the easiest way to combat this is to keep the code short and
simple and not add unnecessary stuff into the code.

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

If Pound.Checked = True And Pound1.Checked = True Then


MsgBox("You must select two different currencies.")
End If
If Pound.Checked = True And Dollar1.Checked = True Then
exchangerate = 1.479
End If
If Pound.Checked = True And Yen1.Checked = True Then
exchangerate = 177.21
End If
If Pound.Checked = True And Euro1.Checked = True Then
exchangerate = 1.3772
End If
If Yen.Checked = True And Yen1.Checked = True Then
MsgBox("You must select two different currencies.")
End If
If Yen.Checked = True And Dollar1.Checked = True Then
exchangerate = 0.00834
End If
If Yen.Checked = True And Pound1.Checked = True Thevn
exchangerate = 0.00564
End If
If Yen.Checked = True And Euro1.Checked = True Then
exchangerate = 0.00776
End If
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
'This is multiplying the exchange rate by the amount to produce the result.'
Result = exchangerate * Amount
'The number is being rounded to the nearest whole number in this line of code'
ResultTextBox.Text = Math.Round(Result, 2, MidpointRounding.AwayFromZero)
end1:
End Sub
End Class

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

Amount box: the amount


that you want to convert
is entered into this box as
an input.

Result box: the


result will be
displayed here as
an output

The user has entered


the amount that they
want to convert in the
amount box.
The
user
selected
currency that
want to convert

has
the
they
to.

The program has now


calculate the result and
has outputted the amount
in the second currency.
The
user
has
selected
the
currency that they
are converting from.

The user has not entered a


The program has recognised
number and as a result the
that the user has not selected
program has come up with an
two different currencies so it has
error message saying enter
come up with an error message
a number.
saying
please
select
two
different currencies.

This is the import/export


feature working. The user in
this case has clicked on the
import
button
and
the
program opens up this box.

I have decided to use this solution as my final design as it is both


atheistically pleasing and is also very simple and straight forward to use.
The minimalistic design makes it easy for any type of user to use and the
design is also linked with the HSBC logo. I used visual basics to make this
design and I also used a HSBC logo, the link will be in the bibliography.

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

This is declaring exchangerate, result and amount as doubles and


decimals.

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

The above is an example of how I have used if statements. If statements


have been used throughout my program has the main technique for
converting the currencies.

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

This is an example of a maths operator. In this line of code the exchange


rate is being multiplied by the amount to obtain the result.

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

successfully without any


issues.

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.

The program successfully


allows the user to pick a
currency

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.

Does the program provide an error message when a number is not


entered into the amount boxes?
Yes the program does which is a very useful feature as it means that I am
informed when I accidently enter a letter instead of a number.
Are there any improvements that you think I could make to my program, if
so state these.
The program overall is very professionally designed however the only
improvement that I think should be made is some instructions to help
users just in case they are completely unable to use the program.

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

Efficiency and performance refer to how well the


program works and how quick it runs. This meant
that I had to think about how fast my program
would run. I also had to think about whether or
not it would crash. I have made sure to create a
program which runs smoothly without any
problems. This meant I had to have a wellstructured code to make sure that it ran without
crashing or lagging. I have made sure to keep my
program simple and necessary so that there
arent any bits of excess code which cause the
program to lag.
Maintainability refers to how easily the program
can be edited in order to fix any problems with
the program. This meant that I had to consider
how I would handle any problems if they were to
arise. My program is very maintainable in terms of
fixing it is easy. It is also easy to edit as I have

Portability

Reliability

Robustness

Usability

kept the structure and the code very simple. I


have also made sure to add comments throughout
the code and meaningful names for variables so
that people dont get confused with what they
are.
Portability refers to how the software works with
different user interfaces. This meant that I had to
make sure that my program can easily be used on
many types of user interfaces. The problem with
this is that every user interface is different and
many problems can arise however I have made
sure that my program is portable by making it
available on many user interfaces. This means
that it can execute the code on any type of
computer system.
Reliability refers to how accurate the outputted
information. This meant that I had to make sure
that the conversion rates and everything were all
accurate. This particular task can be very
challenging as the rates often differ however the
outputs are always accurate because the
conversion rates update with the internet which
means that they will always be accurate. I also
had to think about how often my program is and
how reliable its performance is. I made sure that
the performance is reliable by keeping the code
simple and easy so that it does not crash.
Robustness refers to how the program can cope
and process large amounts of data reliably. This
meant that I had to make sure that my program
could handle the data in a structured way so that
it does not crash. To do this I made sure my
programs code was structured. I also made sure
to create error messages. This meant that when
the program does crash the user will know what is
happening. It also makes the user experience very
good because they understand what is happening.
Usability refers to how easy the program is to use.
This meant that I had to think about the user
experience and how well the program is designed.
This involved creating a design that is fit for
purpose, easy to use and has all of the necessary
functions. This meant that I had to consider all of
the above. My design is very easy to use and it is
very simple. I made sure to keep it simple so that

it is user friendly. I also made sure that its


usability was good by making sure that the code
was structured and no unnecessary parts were
inside it.

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.

Changes and repairs made


Based upon the feedback that I got from my questionnaire I made some
changes and repairs. The change I made is that I have now made sure to
include to a user guide for new users. This means that the users will know
exactly how to use the program straight away without fail. I also had to
make some repairs based upon the debugging that I had to do.

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

https://www.youtube.com/watch?v=cJ-V7ZP7EQc video 1 which I used to help me


program this
https://www.youtube.com/watch?v=OV4qAwSFZcQ video 2
https://www.youtube.com/watch?v=mmAfXTFefQ8 video 3