tasks - nicksportfolio680934441.files.wordpress.com  · web viewtasks. unit 12 – software...

28
6/24/2018 Tasks Unit 12 – Software Development 1598235125 WEST CHESHIRE COLLEGE

Upload: others

Post on 21-Feb-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

6/24/2018

Tasks

Unit 12 – Software Development

1598235125West Cheshire College

Page 2: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Task 2

Introduction:

Purpose of the Program

The company is designing a program, to help users with converting currencies and editable exchange rates. The program will let the user convert British pounds into a different currency such as $ or Euros, the company is also designing it the other way around. So the user can convert $ or Euros or any other currency to British pounds, the company also has to implement a changeable exchange rate, as exchange rates change on quite a regular basis. It should be displayed with the two currencies on the screen, alongside with the current exchange rate on the right.

Functional & Non Functional Requirements:

Performance is a key requirement, such as response time, after the user inputs data and the exchange rate and uses the convert function.

Page 3: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Problem Definition

No online calculating

Slow customer times

Pens, paper and a calculator

They use a dumb terminal, therefor they have no internet access

They have to learn how to work out and understand how exchange rates works

Have a good/basic understand of maths

No online calculating which means, the employee has to know the formula’s and how to figure out how much each customer needs, because if they don’t they could end up giving out a wrong amount.

Page 4: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Requirements

A requirement is something that is necessary, for something to work or complete its function, such as a reference for different natives and functions in C#. Another requirement would be 2 different currencies, the currency you are converting from and the currency you are converting to.

Functional Requirements:

A functional requirement is a function, which is designed to have specific inputs, instructions and behaviours.

Examples:

The execution an application carries out.

Application output.

Business Requirements (Non Functional Requirements):

Currency exchange for customers.

Deadline for customers.

No online calculations.

The calculation is instant, you type in the amount, both the currencies, to and from and then the exchange rate and click calculate and there you go you have the amount.

Input Requirements:  Typing in an amount of money you wish to convert.

Select the currency you are converting from.

Select the currency you are converting to.

Type in your exchange rate

Click convert.

Output Requirements:  The output calculation after inputting both currencies, selecting the current exchange rate and clicking calculate.

Page 5: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Process Requirements:  Converting the first selected currency and the second one with the current exchange rate.

Design:

GUI Designs:

Design 1:

Page 6: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Design 2:

Introduction:

Component Table:

Design 1:

Component Type Component Name Text Type

Font Type

Font Colour

Font Size

Background Colour

1. Label:Used to tell the user the purpose of the application.

lblTitle String American Captain

White, black outer glow

16.26 Dark gray

2. List Box: Used to enter values

lstCurrency String American Captain

White, black outer glow

12 Dark gray

3. List Box: Used to enter values

lstSecondCurrency String American Captain

White, black outer glow

12 Dark gray

4. Text Box: Used to enter values

txtRate String American Captain

White, black outer glow

12 Dark gray

5. List Box: Used to select an item from a list.

lstOperator String American Captain

White, black outer glow

12 Dark gray

Page 7: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

6. Button: Used to trigger an event.

btnConvert String American Captain

White, black outer glow

12 Dark gray

7. Message box: Used to display a message to the user.

msgConvertedAmount

String American Captain

White, black outer glow

12 Dark gray

Design 2:

Component Type

Component Name Text Type Font Type Font Colour

Font Size

Background Colour

1. Label:Used to tell the user the purpose of the application.

lblTitle String Microsoft Sans Serif

Black 19 White

2. Text Box: Used to select an item from a list.

txtAmount Decimal Microsoft Sans Serif

Black 10 White

3. Combo Box: Used to enter values

cmbCurrFrom String Microsoft Sans Serif

Black 10 White

4. Combo Box: Used to select an item from a list.

cmbCurrTo String Microsoft Sans Serif

Black 10 White

5. Text Box: Used to select an item from a list.

txtExchange Decimal Microsoft Sans Serif

Black 10 White

6. Button: Used to trigger an void/method.

btnCalculate String Microsoft Sans Serif

Black 10 White

7. Message box: Used to display a message to the user.

txtTotal String Microsoft Sans Serif

Black 10 White

Page 8: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Navigation:

Type the amount of money you are converting. Select the currency from. Select the currency to. If you wish to update your exchange rate, type it in. Click calculate.

Implemented Requirements Section:

Type the original input number to convert from the first exchange rate to the second.

Typing in the first exchange rate.

Typing in the second exchange rate.

Convert button, to process the converting process of converting the money amount from the first exchange rate to the second.

Text box to display the convert amount.

The process of converting exchange rate 1 to exchange rate 2.

Page 9: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Data Dictionary:

Introduction:The data dictionary represents creating the program, containing all the information of it, the format it is written in and the language, the structure of the relationship between the different variables and methods.

Data Dictionary Table:

Variable Data Type Use

currFrom String - contains letters/characters.

Contains information from what currency you are converting from.

currTo String - contains letters/characters.

Contains information from what “currency to”, you are converting to.

amount Decimal – Used to contain decimal point numbers.

Contains the amount of money you type into the amount textbox, to convert.

exchange Decimal – Used to contain decimal point numbers.

Used to hold your updated exchanged rate and temporarily assign it in the array to the two selected currencies.

result Decimal – Used to contain decimal point numbers.

Used to calculate the final amount, then display it in the total textbox.

What is a variable?

A variable is a container to hold a specific value or store data, such as the time on a Windows OS or a FPS counter on a video game. This can later be referred to for a function or an event

Other examples could be a security key or token, which would separate one users from others, such as an email address.

Page 10: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Procedures/Software:

Method Name What does it do?

exchangeArray() The holds information for the currency from and to, from the combo boxes then assigns exchange rates to the selected options.

btnCalculate_Click() This method triggers the “storeData()” method.storeData() This method assigns the selected item from the

combo box “cmbCurrFrom” & “cmbCurrTo”, converts it to a string an assigns it to the variable “currFrom” & “currTo”. Then it grabs the information from the text box “txtAmount.Text”, converts it to a decimal and stores it into the decimal variable amount.

Once it has all of that it runs the exchange rate method “chkRate()”

chkRate() This method checks if the string inside “txtExchange.Text” has text, if it does, convert the information inside “txtExchange.Text” to a decimal, and then store it inside the variable exchange. Once that is done trigger the method “updateRate()”

If it isn’t then trigger the “findExchangeRate()” method.

grab the information from the two chosen currencies and grab the exchange rate assigned to the chosen currencies. Then stop, set the count to 2, then trigger the “calculate()” method.

updateRate() This method checks if something is inside the text box “txtExchange.Text” if so, update the exchange array with the two chosen currencies with the exchange rate entered into the text box.

findExchangeRate() This method checks what currency is entered into the currFrom and currTo combo box, then it checks them inside of the array and grabs the exchange rate for them two currencies.

Then it converts the exchange rate from the array to a decimal and assigns it to the variable “exchange”, then stop this, adds 2 to the count and triggers the method calculate.

calculate() This method sets the variable “result” to the variables amount times exchange. Then triggers the method “display()”.

display() This method converts what is inside the variable result from the multiplication calculation, converts it to a string and puts it inside the text box “txtTotal.Text” to display the calculated amount in that text box.

Page 11: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Flow Chart:

Page 12: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Test Data:Test number Test Description Test Data Expected1 Checks you can enter

money.Decimal To display the keys into

the text box, when they are pressed.

2 Checks the combo box items from “cmbCurrFr” can be selected.

GBP, US Dollar, Euro To be able to select GBP, US Dollar, Euro.

3 Checks the combo box items from “cmbCurrFr” can be selected.

GBP, US Dollar, Euro To be able to select GBP, US Dollar, Euro.

4 Checks if the default exchange rate works from the array.

Grabs the exchange rate from the array based on your currency selection.

Grab the exchange rate from the array.

5 Grabs your entered exchange rate from the “txtExchange.Text” and assigns it temporarily to the currencies you have chosen.

Characters entered “txtExchange.Text”

To add the updated exchange rate into the calculation of your two currencies.

6 When the calculate button is pressed it triggers the calculate method.

btnCalculate To trigger the calculate method.

When a letter is entered into the amount textbox, the application will crash, due to the fact it takes the number entered into it and converts it into a decimal.

Justification for the design:

Out of both of my designs, my second one is much better as the design has a more easy to use, interactive, better base scheme, and layout. The application in the second design is improved with colour and contrast as the other one was very basic and bland, hard to read and see. The red with the white makes the contrast and saturation, so users with colour impairment can use it without any stress.

The font size on the second is much easier to read, understand and fits better with the colour design. The colours red and white make the contrast and saturation much easier to read for people who are colour blind, bad eye sight or even ileums. The boxes are very basic on the design with clear basic titles, so it is easy to use the VAT converter if you didn’t know what you were doing. The drop-down lists are easy and basic with 3 currencies GBP, US Dollar and Euro. The calculate button is easy to see and shows that it is a button, with the text calculate. So, users will know it is clickable, once they have entered their user data which they want to convert. Title is pretty big and basic “Currency Converter”. When entering a character into the amount text box which uses a number or a decimal if you will. It will display the message “This is for money amount, please don't use letters/words.”, including the error code.

The second design will include all input requirements such as, money amount, currency from and to including 3 currencies. There is an including text box to update an exchange rate or enter a custom exchange rate with the calculate button to calculate all math calculations without using the internet.

Both designs have basic, and helpful ease of use, however the second is much easier to navigate, read and use, the buttons are better layed out and all the boxes and titles are positioned and to equal quality and scale.

Page 13: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Task 3:

Code Dump (Broken):

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;

namespace VAT_Application{ public partial class Form1 : Form {

// These are variables, a variable is used to store information, which can later on be referenced too or used.

string currFrom = ""; // This variable is to identify what currency you are changing from. string currTo = ""; // This variable is to identify what currency you are changing to. decimal amount = 0; // This variable is to identify the entered money to change from one currency to another, with VAT. decimal exchange = 0; // This variable is to identify the exchange rate decimal result = 0; // This variable is to calculate the total amount of the exchanged amount.

public Form1() { InitializeComponent(); }

// This an array, it is used to hold information, similar to a table, which can later be referenced to with count.

// It is being used on our program to hold currencies and exchange rate.

private string[,] exchangeArray = { { "GBP", "US Dollar", "1.33" } , { "US Dollar", "GBP", "0.75" }, { "GBP", "Euro", "1.14" }, { "Euro", "GBP", "0.87" }, { "US Dollar", "Euro", "0.86" }, { "Euro", "US Dollar", "1.16" }, };

private void txtAmount_TextChanged(object sender, EventArgs e) {

}

private void txtExchange_TextChanged(object sender, EventArgs e) {

}

private void txtTotal_TextChanged(object sender, EventArgs e) {

}

private void cmbCurrFrom_SelectedIndexChanged(object sender, EventArgs e)

Page 14: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

{

}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) {

}

private void cmbCurrTo_SelectedIndexChanged(object sender, EventArgs e) {

}

private void Form1_Load(object sender, EventArgs e) {

} // This button is used to trigger the void "storeData();" private void btnCalculate_Click(object sender, EventArgs e) { storeData(); }

public void storeData () { currFrom = (string)cmbCurrFrom.SelectedItem; // Getting the value from select currency from and assisning it to the variable "currFrom" currTo = (string)cmbCurrTo.SelectedItem; // Getting the value from select currency to and assisning it to the variable "currTo" amount = Convert.ToDecimal(txtAmount.Text); // Getting the value the user inputs and assigns it to the variable "amount"

chkRate(); // This runs the check exchange rate method. }

public void chkRate() { if (!string.IsNullOrEmpty(txtExchange.Text)) // This checks the exchange rate entered into "txtExchange.Text" { updateRate(); // Then updates the exchange rate with the "updateRate()" void. } else { findExchangeRate(); // Else if nothing is entered in, then use the "findExchangeRate()" void. } }

public void updateRate() { int count = 0;

while (count < exchangeArray.GetUpperBound(0)) { if (currFrom.Equals(exchangeArray[count, 0]) && (currTo.Equals(exchangeArray[count, 1]))) // This method does grabs the information entered into the update exchange rate text box and updates it to the from and to currencies { exchangeArray[count, 2] = Convert.ToString(exchange); // and temporarily assign it to the previous exchange rate.

break; } count++; } calculate(); }

public void findExchangeRate() { int count = 0;

Page 15: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

while (count < exchangeArray.GetUpperBound(0)) { if(currFrom.Equals(exchangeArray[count, 0]) && (currTo.Equals(exchangeArray[count, 1]))) // This grabs the assigned exchange rate in the array, from the entered currency from and to. { exchange = Convert.ToDecimal(exchangeArray[count, 2]);

break; } count++; } calculate(); }

public void calculate() { result = amount * exchange; // This identifies that the variable result is and/or means amount variable times by the exchange variable.

display(); // Then triggering the "display()" void, to display the calculated amount. }

public void display() { txtTotal.Text = Convert.ToString(result); // This converts the result variable to a string, and then inputs the data into the txtTotal textbox. } }}

Page 16: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Test Plan (Broken):

Test No

Description Action Expected Result Actual Result

1. Inputting amount of money. Keyboard/Text. Money to appear in the text box. Money to appear in the text box.2. Selecting currency from. Combo Box. Selected currency from, from combo

box to be selected.Selected currency from, from combo box to be selected.

3. Selecting currency to. Combo Box. Selected currency to, from combo box to be selected.

Selected currency to, from combo box to be selected.

4. Custom exchange rate. Keyboard/Text. Exchange rate to be added into the calculation, to replace the current one temporarily.

Update exchange rate is being displayed as 0.

5. Clicking the calculate button to display the calculated amount.

Mouse. Button to display calculated amount in total text box.

Final amount is being displayed without using update exchange rate option, however there are 2 extra digits to every final calculation.

Page 17: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Code Dump (Working):

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;

namespace VAT_Application{ public partial class Form1 : Form {

// These are variables, a variable is used to store information, which can later on be referenced too or used.

string currFrom = ""; // This variable is to identify what currency you are changing from. string currTo = ""; // This variable is to identify what currency you are changing to. decimal amount = 0; // This variable is to identify the entered money to change from one currency to another, with VAT. decimal exchange = 0; // This variable is to identify the exchange rate decimal result = 0; // This variable is to calculate the total amount of the exchanged amount.

public Form1() { InitializeComponent(); }

private string[,] exchangeArray = { { "GBP", "US Dollar", "1.33" } , { "US Dollar", "GBP", "0.75" }, { "GBP", "Euro", "1.14" }, { "Euro", "GBP", "0.87" }, { "US Dollar", "Euro", "0.86" }, { "Euro", "US Dollar", "1.16" }, };

// This an array, it is used to hold information, similar to a table, which can later be referenced to with count.

// It is being used on our program to hold currencies and exchange rate.

private void txtAmount_TextChanged(object sender, EventArgs e) {

}

private void txtExchange_TextChanged(object sender, EventArgs e) {

}

private void txtTotal_TextChanged(object sender, EventArgs e) {

}

private void cmbCurrFrom_SelectedIndexChanged(object sender, EventArgs e) {

}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) {

Page 18: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

}

private void cmbCurrTo_SelectedIndexChanged(object sender, EventArgs e) {

}

private void Form1_Load(object sender, EventArgs e) {

} private void btnCalculate_Click(object sender, EventArgs e) { storeData(); // This button is used to trigger the void "storeData();" }

public void storeData () { try // Attempt this. { currFrom = (string)cmbCurrFrom.SelectedItem; // Getting the value from select currency from and assisning it to the variable "currFrom" currTo = (string)cmbCurrTo.SelectedItem; // Getting the value from select currency to and assisning it to the variable "currTo" amount = Convert.ToDecimal(txtAmount.Text); // Getting the value the user inputs and assigns it to the variable "amount"

chkRate(); // This runs the check exchange rate method. }

catch (Exception error) // If it does not work, display this error message. { MessageBox.Show("This is for money amount, please don't use letters/words." + error); // Error message. } }

public void chkRate() { if (!string.IsNullOrEmpty(txtExchange.Text)) // This checks the exchange rate entered into "txtExchange.Text" { exchange = Convert.ToDecimal(txtExchange.Text); updateRate(); // Then updates the exchange rate with the "updateRate()" void. } else // If not then do this below. { findExchangeRate(); // Else if nothing is entered in, then use the "findExchangeRate()" void. } }

public void updateRate() { int count = 0; // This is setting the count variable to default 0.

while (count < exchangeArray.GetUpperBound(0)) // This is saying whilst if the count is less than the exchange array. { if (currFrom.Equals(exchangeArray[count, 0]) && (currTo.Equals(exchangeArray[count, 1]))) // This method does grabs the information entered into the update exchange rate text box and updates it to the from and to currencies { exchangeArray[count, 2] = Convert.ToString(exchange); // and temporarily assign it to the previous exchange rate.

break; // Then stop. } count++; // This sets count + 1 + 1, this is just a shorter version. } calculate(); // This triggers the calculate void. }

Page 19: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

public void findExchangeRate() { int count = 0; // This is setting the count variable to default 0.

while (count < exchangeArray.GetUpperBound(0)) // This is saying whilst if the count is less than the exchange array. { if(currFrom.Equals(exchangeArray[count, 0]) && (currTo.Equals(exchangeArray[count, 1]))) // This grabs the assigned exchange rate in the array, from the entered currency from and to. { exchange = Convert.ToDecimal(exchangeArray[count, 2]); // This sets the exchange variable = the exchangeArray converted into a decimal. Placed into the second currency.

break; // Then stop. } count++; // This sets count + 1 + 1, this is just a shorter version. } calculate(); // This triggers the calculate void. }

public void calculate() { result = amount * exchange; // This identifies that the variable result is and/or means amount variable times by the exchange variable.

display(); // Then triggering the "display()" void, to display the calculated amount. }

public void display() { txtTotal.Text = Convert.ToString(result); // This converts the result variable to a string, and then inputs the data into the txtTotal textbox. } }}

Page 20: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Test Plan (Working):

Test No

Description Action Expected Result

Actual Result

1. Inputting amount of money. Keyboard/Text. Money to appear in the text box.

Money to appear in the text box.

2. Selecting currency from. Combo Box. Selected currency from, from combo box to be selected.

Selected currency from, from combo box to be selected.

3. Selecting currency to. Combo Box. Selected currency to, from combo box to be selected.

Selected currency to, from combo box to be selected.

4. Custom exchange rate. Keyboard/Text. Exchange rate to be added into the calculation, to replace the current one temporarily.

Updated exchange rate, updates the exchange rate in the calculation.

5. Clicking the calculate button to display the calculated amount.

Mouse. Button to display calculated amount in total text box.

Button to display calculated amount in total text box.

Page 21: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Task 4:

Witness Statement: - Helen needs to do this

Peer Feedback:

Brandon V:

Page 22: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Rory Cullen:

Page 23: Tasks - nicksportfolio680934441.files.wordpress.com  · Web viewTasks. Unit 12 – Software Development. Task 2. Introduction: Purpose of the Program. The company is designing a

Review: - Need to do.

Review Original Requirements:

Extend of Suitability: