Nathaniel Derrick Unit 12: Software Development Assignment 2

advertisement
Nathaniel Derrick
Unit 12: Software Development
Assignment 2: Design a Software Program
Purpose and Requirements:
The client for the software program is a local Travel Agent. The travel agent wants the program to
convert currency from British Pound Sterling, to another foreign currency and vice versa. The user of
the program would be anyone 18 and above in the general public. The predicted IT ability of the
audience is quite low, as there could be many people who do not know how to, or simply don’t use
computers.
What does the program need to do? How should the software perform?
 Convert British Pound Sterling to a foreign currency.
 Convert foreign currency back into British Pound Sterling.
 Should not freeze/ crash.
 Should be easy to understand, and easy to use.
 Display the results.
Problem Definition:
The user will have to input the amount of the currency they want to covert, and the exchange rate of
the currency they want to convert it into.
The calculation would be a multiplication of the currency and the exchange rate.
Two things will need to be displayed; either the converted currency, or if incorrect data was entered
into the ‘Currency’ or ‘Exchange Rate’ text boxes then an error message will need to be displayed.
The program should be easy to use, the layout should be simple so that it doesn’t confuse people –
the interface should not be crowded / cluttered.
The results should be accurate to two decimal places.
Proposed Solution:
The program will be using a visual interface, as this is much simpler and clearer when compared to a
console configuration.
The user will be allowed to enter data, in the form of decimal numbers, into the currency amount text
box and the exchange rate text box – the form will have both.
The form will have two text boxes that the user can enter decimal numbers into, and it will have one
display box next to them showing the result.
The form will be in a pastel or neutral colours, as these are not ‘offensive’ to the eye, and usually
cause the eye to relax – this will mean the user doesn’t have to strain as hard to read information on
the screen.
The form will also include a drop down list showing different exchange rates, this way the user will
not have to remember the exchange rates they want or need.
The program will need to multiply the data input into two text boxes together. Because of this, the
user will be limited to inputting decimal or whole number values into the text boxes, an error
message being shown if they enter incorrect characters.
Input
-
Amount to be
converted.
Exchange rate.
Process
Multiply Amount by
Exchange rate.
Check Amount is
correct data type.
Output
Converted currency –
Amount Due.
Error message if
incorrect data is input.
Nathaniel Derrick
Unit 12: Software Development
Pre-defined Programs & Functions:
 Pre-defined Program - Already have code to do conversions. Conversion of currencies e.g. British
Pound Sterling – US Dollar, European Euro – Russian Ruble etc…
 Pre-defined Function - Already have code to do mathematical sums e.g. Adding, Subtracting,
Multiplication etc…
 Pre-defined Function - Already have validation code that checks to make sure the user has only
entered correct characters.
 Pre-defined Function - Code that displays an error message – connected to validation code.
Test
Logic – Currency conversion
Refer to test data 1
Logic – Error handling
Refer to test data 2
Functionality – Test calculate
button
Functionality – Test text boxes
Functionality – Test form loads
Logic – Error handling
Method
Input Amount and Exchange Rate.
Expected Outcome
Output Amount is correct.
Input incorrect characters into
Amount and/or Exchange Rate.
Enter an appropriate amount, and
click the calculate button.
Attempt to type into the text box.
Open the program.
Leave input boxes empty.
Error message is displayed.
Logic – Error handling
Refer to test data 3
Input minus numbers.
Result is displayed and is correct.
Characters will appear in text box.
Program loads properly.
Error message displayed, but
program does not crash.
Error message is displayed.
Test Data:
1. Amount = 100 (Pound Sterling)
Exchange Rate = 1.25 (Example)
Correct outcome = 125 (Alternate Currency)
2. Incorrect character examples = “!, £, $, %, ^, &, (, ), :, ~ etc…”
The program should only be able to recognise numbers – (0 1 2 3 4 5 6 7 8 9)
3. Use numbers outside of the acceptable range
e.g. Use minus numbers or Enormous numbers
Form objects
(-100 or 1,000,000,000…)
colour is Light
Blue.
Wire-frame form designs:
Label, will use
arial font, size 14
Text Box, arial
font, size 12
Currency Converter
Enter Amount
Convert
Button, arial
font, block
capitals, size 12
New Amount
Link to Usage instructions
Convert button
colour is light
purple.
Background
colour is Faint
Blue.
Link & New Amount
Labels colour is Light
Green.
Select Exchange Rate
↓
Drop-down menu,
arial font.
Title size: 14.
List font size: 12.
Nathaniel Derrick
Unit 12: Software Development
The ‘Usage Instructions’ will explain what the program is used for, and how to use it. Included in the
instructions is a link that opens the program – this is useful as the instructions can be downloaded and the user
can access the currency converter through the document.
Main Form
Instructions Document
Button that, when clicked, opens
the instructions document.
Blue Link to the program
Alternative Solutions:
The form includes a drop-down menu; this can cause it to appear cluttered. The drop-down list is an important
part of the design so it could be moved rather than removed – possibly moving it underneath the text box may
make the form look more orderly.
Input of data is simple, but requires the user to enter an amount – the user would need to enter unbanned
characters or the program will display an error message. A drop-down menu could be used with a list of
Exchange Rates, eliminating the need for the user to enter the Rate manually, consequentially eliminating
errors with the Exchange Rate.
A button could be added, linking to a document containing instructions. The document itself can contain a link
back to the program – this will make it easier to use for the user.
Because the Exchange Rates are already set by the drop-down menu list, the code will most likely be slightly
more complicated – drop-down menu require more configuring compared to a simple text box.
The mathematical functioning of the program and code is to simply multiply the Amount entered by the user,
by the Exchange Rate selected from the list by the user.
The code will include validation and error handling sections, preventing the user from attempting to convert
incorrect characters such as %,&, ^ or letters etc…
The Amount of money in the new currency will be displayed in a ‘label’ box – meaning the user cannot enter
text into the box.
The Form, and all objects on the form will be light colours, so the form is not offensive to the eye.
Another alternative for the Exchange Rates, could be that they’re updated in real-time from the internet,
provided there is an internet connection available.
Nathaniel Derrick
Unit 12: Software Development
Data items:




Amount in ‘Pound Sterling’ – Decimal
Exchange Rate – Decimal
Converted Amount in foreign currency – Decimal
Exchange Rates (database) x10 - List
Validation, Functions & Error handling:
An IF statement will look for values entered within a specified range – if the value entered by the user
is not within that range, en error message will be displayed informing the user of the issue.
Selecting values for the Exchange Rate is also another form of validation, as it stops the user from
entering incorrect data into that part of the program.
Any other errors can be caught be ‘Try Catch’, a piece of code that searches for any issues with the
program, stopping the program and displaying an error message if and when it does.
Download