Currency Control System

1 - System and Interacting System - System Object Model

System Requirements Statement - Currency Control System

The Currency Control System is a S/W program that interacts with currency control equipment to store and exchange various international currencies. The Currency Control System responds to the following commands:

- Set Available Currency Funds, e.g. DM funds = 1000,

- Get Available Currency Funds, e.g. DM funds = 1000,

- Set a Currency Exchange Rate, e.g. US -> DM = 1.50,

- Get a Currency Exchange Rate, e.g. US -> DM = 1.50.

- Exchange a Currency, e.g. 10 US -> 15DM.

The Currency Control System responds to these commands with the following responses:

- Display Status, e.g. DM funds = 1000,

- Dispense an Amount of a Currency, e.g. DM = 15.

The following information (data) is passed between the HW Equipment and the Currency Control System:

- an in currency type, e.g. US, DM, FR,

- an in currency amount, e.g. 100,

- an out currency type, e.g. US, DM, FR,

- an out currency amount, e.g. 150,

- a currency exchange rate, e.g. 1.5.

A currency exchange rate is a float that is used to convert an amount of an input currency to compute the amount of an output currency, e.g. the currency exchange rate of a US dollar to a Deutschemark is 1.5. A in currency amount or out currency amount is an integer. It is an input amount that a user inputs and an output amount that a user receives during an exchange. An in currency type or out curreny type is an available international currency, e.g. US, DM, and FR.

System Drawing - Currency Control System


System Block Diagram (Inputs and Outputs) - Currency Control System


System Diagram (OMT Notation) - Currency Control System

System Table - Currency Control System

System Name Attribute NamesSystem Operation Names
CurrencyControlSystemavailCurrency currencyRates inCurrencyType outCurrencyType inCurrencyAmount outCurrencyAmount getAvailCurrency setAvailCurrency getCurrencyRate setCurrencyRate exchangeCurrency
HWEquipmentdispenseCurrency displayStatus

System Specification Report - Currency Control System

System Name: Currency Control System

System Access: Public

System Imports: NA

Enclosing System: NA

System Description: The Currency Control System controls the exchange of currencies.

Data Dictionary - Currency Control System

Entity Name Type of EntityEnclosing System
CurrencyControlSystemSystem --
availCurrencyAttribute CurrencyControlSystem
currencyRatesAttribute CurrencyControlSystem
inCurrencyTypeAttribute CurrencyControlSystem
outCurrencyTypeAttribute CurrencyControlSystem
inCurrencyAmountAttribute CurrencyControlSystem
outCurrencyAmountAttribute CurrencyControlSystem
getAvailCurrencySystem Operation CurrencyControlSystem
setAvailCurrencySystem Operation CurrencyControlSystem
getCurrencyRateSystem Operation CurrencyControlSystem
setCurrencyRateSystem Operation CurrencyControlSystem
exchangeCurrencySystem Operation CurrencyControlSystem
HWEquipmentSystem--
dispenseCurrencySystem Operation HWEquipment
displayStatusSystem Operation HWEquipment

2 - System Input and Output Events - System Dynamic Model

System Use Case Diagram - Currency Control System


System Use Cases/Sub-use Cases Table

NumberInitiating Actor Use Case/Subuse CaseUse Case Description
1Maintainer Maintain Currency SystemGeneral use case with sub-use cases
1.1MaintainerSet Available Currency Input Event - setAvailableCurrency, Output Event - displayStatus
1.2MaintainerGet Available Currency Input Event - getAvailableCurrency, Output Event - displayStatus
1.3MaintainerSet Currency Rate Input Event - setAvailableCurrency, Output Event - displayStatus
2UserUse Currency System General use with sub-use cases
2.1UserGet Currency Rate Input Event - getCurrencyRate, Output Event - displayStatus
2.2UserExchange Currency Input Event - exchangeCurrency, Output Event - dispenseCurrency

System Interaction Diagram - Currency Control System


System Interaction Scenario - Currency Control System

Use Case Table - Maintain Currency System Use Case

Sequence Number Sender SystemReceiver System Invoked OperationDescription
1HW EquipmentCurrency Control System setAvailableCurrencyInput Event
2Currency Control System HW EquipmentdisplayStatus Output Event
3HW EquipmentCurrency Control System getAvailableCurrencyInput Event
4Currency Control System HW EquipmentdisplayStatus Output Event
5HW EquipmentCurrency Control System setCurrencyRateInput Event
6Currency Control System HW EquipmentdisplayStatus Output Event

Use Case Table - Use Currency System Use Case

Sequence NumberSender System Receiver SystemInvoked Operation Description
1HW EquipmentCurrency Control System getCurrencyRateInput Event
2Currency Control System HW EquipmentdisplayStatus Output Event
3HW EquipmentCurrency Control System exchangeCurrencyInput Event
4Currency Control System HW EquipmentdisplayStatus Output Event
5Currency Control System HW EquipmentdispenseCurrency Output Event

Creams () Returns number of creams

3 - System Operations - System Functional Model

System Context Diagram - Currency Control System


The basic transformation is the exchangeCurrency system operation that computes an Out Currency Amount based upon an In Currency Amount, In Currency Type, and Out Currency Type. The basic transformation is:

Out Currency Amount = In Currency Amount * currencyRates [In Currency Type]

Correctness assertions must be identified to ensure that correct outAmount's are computed.

System Function Table - Currency Control System

System Operation Name Input ParametersTransformation Return Type
getAvailCurrencyOutCurrencyType int
setAvailCurrencyOutCurrencyType OutCurrencyAmount Update outCurrencyAmountvoid
getCurrencyRateOutCurrencyType InCurrencyType float
setCurrencyRateOutCurrencyType InCurrencyType CurrencyRate Update currencyRates
exchangeCurrencyInCurrencyType InCurrencyAmount OutCurrencyType outCurrencyAmount = currencyRates [inCurrencyType] * inCurrencyAmount int

4 - Classes and Relationships - Object Model

Class Diagram - Currency Control System


Class Table - Currency Control System

Class NameAttribute Names Relationship Traversal Path Names Operation Names
CurrencyavailCurrency currencyRates setAvailCurrency getAvailCurrency getCurrencyRate setCurrencyRate exchangeCurrency
USCurrency exchangeCurrency
DMCurrency exchangeCurrency
CurrencyControlleraDM aUS setAvailCurrency getCurrencyRate setCurrencyRate exchangeCurrency getAvailCurrency
HWInterfaceaCurrencyController dispenseCurrency setAvailCurrency getCurrencyRate setCurrencyRate exchangeCurrency getAvailCurrency

Data Dictionary for Object Model - Currency Control System

Entity NameType of Entity Enclosing Class
CurrencyClass--
availCurrencyAttribute Currency
currencyRatesAttribute Currency
setAvailCurrencyOperation Currency
getAvailCurrencyOperation Currency
getCurrencyRateOperation Currency
setCurrencyRateOperation Currency
exchangeCurrencyOperation Currency
USCurrencyClass--
exchangeCurrencyOperation USCurrency
DMCurrencyClass--
exchangeCurrencyOperation DMCurrency
CurrencyControllerClass --
setAvailCurrencyOperation CurrencyController
getCurrencyRateOperation CurrencyController
setCurrencyRateOperation CurrencyController
exchangeCurrencyOperation CurrencyController
getAvailCurrencyOperation CurrencyController
aDMTraversal Path for 1:1 Aggregation CurrencyController
aUSTraversal Path for 1:1 Aggregation CurrencyController
HWInterfaceClass--
dispenseCurrencyOperation HWInterface
setAvailCurrencyOperation HWInterface
getCurrencyRateOperation HWInterface
setCurrencyRateOperation HWInterface
exchangeCurrencyOperation HWInterface
getAvailCurrencyOperation HWInterface
aCurrencyControllerTraversal Path for 1:1 Aggregation HWInterface

5 - Objects and Messages - Dynamic Model

Object Interaction Diagram - Maintain Currency Use Case


Object Interaction Scenario - Maintain Currency System Use Case

Sequence #Sender System/Object Receiver System

/Object

Invoked OperationDescription
1HWEquipmentaHWInterface getAvailableCurrencyInput Event
2aHWInterfaceaCurrencyController getAvailableCurrencyMessage
3aCurrencyController aCurrencygetAvailableCurrency Message
4aHWInterfaceHWInterface displayStatusOutput Event
5HWEquipmentaHWInterface setAvailableCurrencyInput Event
6aHWInterfaceaCurrencyController setAvailableCurrencyMessage
7aCurrencyController aCurrencysetAvailableCurrency Message
8aHWInterfaceHWInterface displayStatusOutput Event
9HWEquipmentaHWInterface setCurrencyRateInput Event
10aHWInterfaceaCurrencyController setCurrencyRateMessage
11aCurrencyController aCurrencysetCurrencyRate Message
12aHWInterfaceHWInterface displayStatusOutput Event

Object Interaction Scenario - Use Currency System Use Case

Sequence #Sender System/Object Receiver System

/Object

Invoked OperationDescription
1HWEquipmentaHWInterface getCurrencyRateInput Event
2aHWInterfaceaCurrencyController getCurrencyRateMessage
3aCurrencyController aCurrencygetCurrencyRate Message
4aHWInterfaceHWInterface displayStatusOutput Event
5HWEquipmentaHWInterface exchangeCurrencyInput Event
6aHWInterfaceaCurrencyController exchangeCurrencyMessage
7aCurrencyController aCurrencyexchangeCurrency Message
8aHWInterfaceHWInterface displayStatusOutput Event
9aHWInterfaceHWInterface dispenseCurrencyOutput Event

6 - Transformations and Correctness Assertions - Functional Model

Data Flow Diagram - Exchange Currency in a Currency Subclass


The basic transformation is the exchangeCurrency operation

void int exchangeCurrency (Currency anInCurr, int anInCurrAmt)

transformation: int anOutAmount = anInCurrAmt * currencyRates [anInCurr]

Correctness assertions must be identified to ensure that correct outAmount's are computed.

Class NameOperation Name Input ParametersTransformation Return Type
CurrencysetAvailCurrency int amountavailCurrency = amount void
CurrencygetAvailCurrency int
CurrencygetCurrencyRate Currencies anInCurrfloat
CurrencysetCurrencyRate Currencies anInCurr

float aRate

currencyRates [anInCurr] = aRate void
CurrencyexchangeCurrency Currencies anInCurr

int anInCurrAmt

int
USCurrencyexchangeCurrency Currencies anInCurr

int anInCurrAmt

int anOutAmount = anInCurrAmt * currencyRates [anInCurr] int
DMCurrencyexchangeCurrency Currencies anInCurr

int anInCurrAmt

int anOutAmount = anInCurrAmt * currencyRates [anInCurr] int
CurrencyControllersetAvailCurrency Currency* aCurrency

int amount

void
CurrencyControllergetCurrencyRate Currency* aCurrency Currencies anInCurr float
CurrencyControllersetCurrencyRate Currency* aCurrency Currencies anInCurr

float aRate

CurrencyControllerexchangeCurrency Currency* aCurrency Currencies anInCurr

int anInCurrAmt

CurrencyControllergetAvailCurrency Currency* aCurrency int
HWInterfacedispenseCurrency int anOutAmtvoid
HWInterfacesetAvailCurrency Currencies anOutCurr

int amount

void
HWInterfacegetCurrencyRate Currencies anInCurr Currencies anOutCurr void
HWInterfacesetCurrencyRate Currencies anInCurr Currencies anOutCurr

float aRate

HWInterfaceexchangeCurrency Currencies anInCurr Currencies anOutCurr

int anInCurrAmt

HWInterfacegetAvailCurrency Currencies anOutCurr void

7 - System/Subsystems for the H/W and S/W Configuration

Currency Control System Hardware and Software Configuration

ElementPrototype Production Implementation
ProcessorsSingle Processor Intel Processor Single Processor Intel Processor
DevicesDisplayHW Equipment
Operating SystemMS-DOS MS-DOS
Graphic User InterfaceText Only Text Only
LanguageC++C++
LibrariesN/AN/A
Components/DLLs/EXEsCURRENCY.EXE CURRENCY.EXE
Processes/Threads/TasksN/A N/A
Persistent Data StorageC++ Streams TBD
Distribution and ConnectivityN/A N/A
Test Cases55
Help/User/Installation DocumentationN/A Yes

System/Subsystem Diagram

The Processor - Processes Diagram displays the processor and concurrent processes in the system as boxes. In the Currency Control System there is only one processor with a single process. There is no concurrency.

8 - User/External Interfaces

User Interface Drawing

9 - Persistent Storage - TBD

10 - Distribution and Connectivity - N/A

Prototype in C++ - Currency Control System

(Generated code and main combined into a single file. No correctness assertions are provided.)

//Currency Control System C++ Prototype

//Condensed single file C++ prototype for educational purposes

#include <iostream.h>

enum Currencies { US, DM, FR }; //Global Type Declaration

///////////////////////////////////////////////////////////////

class Currency { //Base Class

protected:

int availCurrency;

float currencyRates [2];

public:

void setAvailCurrency (int amount){availCurrency = amount; }

int getAvailCurrency () {return availCurrency; }

float getCurrencyRate (Currencies anInCurr)

{ return currencyRates [anInCurr]; }

void setCurrencyRate (Currencies anInCurr, float aRate)

{currencyRates [anInCurr] = aRate; }

virtual int exchangeCurrency (Currencies anInCurr, int anInCurrAmt) = 0;

};

////////////////////////////////////////////////////////////////

class USCurrency : public Currency {//Derived Class - Details to

public: // be added

int exchangeCurrency (Currencies anInCurr, int anInCurrAmt)

{ int anOutAmount = anInCurrAmt * currencyRates [anInCurr];

return anOutAmount;}

};

////////////////////////////////////////////////////////////////

class DMCurrency : public Currency { //Derived Class - Details to

public: // be added

int exchangeCurrency (Currencies anInCurr, int anInCurrAmt)

{ int anOutAmount = anInCurrAmt * currencyRates [anInCurr];

return anOutAmount;}

};

///////////////////////////////////////////////////////////////

class CurrencyController {

public:

DMCurrency aDM;

USCurrency aUS;

void setAvailCurrency (Currency *aCurrency, int amount)

{ aCurrency -> setAvailCurrency (amount); }

float getCurrencyRate (Currency *aCurrency, Currencies anInCurr)

{ float aRate = aCurrency -> getCurrencyRate (anInCurr);

return aRate;}

void setCurrencyRate (Currency *aCurrency, Currencies anInCurr, float aRate)

{ aCurrency -> setCurrencyRate (anInCurr, aRate); }

int exchangeCurrency (Currency *aCurrency, Currencies anInCurr, int anInCurrAmt)

{ int anOutAmount;

anOutAmount = aCurrency -> exchangeCurrency (anInCurr, anInCurrAmt);

return anOutAmount; }

int getAvailCurrency (Currency *aCurrency)

{int anAmount = aCurrency -> getAvailCurrency ();

return anAmount; }

};

///////////////////////////////////////////////////////////////

class HWInterface {

CurrencyController aCurrencyController;

public:

//void displayStatus (String aString) { } //Calls to cout <<

//simulate calls to displayStatus

void dispenseCurrency (int anOutAmt)

{cout << "The dispensed amount is " << anOutAmt << ".\n"; }

void setAvailCurrency (Currencies anOutCurr, int amount)

{if (anOutCurr == DM) aCurrencyController.setAvailCurrency (&aCurrencyController.aDM, amount); }

void getCurrencyRate (Currencies anInCurr, Currencies anOutCurr)

{ float aRate = 0.0;

if (anOutCurr == DM)

{ aRate = aCurrencyController.getCurrencyRate (&aCurrencyController.aDM, anInCurr);

cout << "The current rate is " << aRate << ".\n";}

}

void setCurrencyRate (Currencies anInCurr, Currencies anOutCurr, float aRate)

{ if (anOutCurr == DM)

{ aCurrencyController.setCurrencyRate (&aCurrencyController.aDM, anInCurr, aRate);

cout << "The current rate has been set to " << aRate << ".\n";}

}

void exchangeCurrency (Currencies anInCurr, Currencies anOutCurr, int anInCurrAmt)

{ int anOutAmount;

if (anOutCurr == DM) {

anOutAmount = aCurrencyController.exchangeCurrency (&aCurrencyController.aDM, anInCurr, anInCurrAmt);

dispenseCurrency (anOutAmount);}

}

void getAvailCurrency (Currencies anOutCurr)

{ int anAmount = 0;

if (anOutCurr == DM)

{ anAmount = aCurrencyController.getAvailCurrency (&aCurrencyController.aDM);

cout << "Current available currency is " << anAmount << ".\n"; }

}

};

///////////////////////////////////////////////////////////////

int main () //Test Case

{ HWInterface aHWInterface;

cout << "Setting the available currency for DM - Deutschemarks.\n";

aHWInterface.setAvailCurrency (DM, 1000);

aHWInterface.getAvailCurrency (DM);

cout << "Setting the current exchange rate for DM - Deutschemarks.\n";

aHWInterface.setCurrencyRate (US, DM, 1.5);

aHWInterface.getCurrencyRate (US, DM);

cout << "Exchanging 1 US dollar for Deutschemarks.\n";

aHWInterface.exchangeCurrency (US, DM, 1);

return 0; }

///////////////////////////////////////////////////////////////

//Sample Output

//Setting the available currency for DM - Deutschemarks.

//The available currency is 1000.

//Setting the current exchange rate for DM - Deutschemarks.

//The current rate has been set to 1.5.

//The current rate is 1.5.

//Exchanging 1 US dollar for Deutschemarks.

//The dispensed amount is 1.

free cialis submit=free cialis cialis com cialis order java.js buy cheap cialis online cialis exchange link cialis tadalafil american express viagra cialis buy cialis link mycialsnowprohostingcom onlinehtml cialis impotence drug eli lilly co cialis without prescription in detroit area why cialis buy cialis link onlinehtm pharmacyrxfreewebtoolscom cialis in south africa do u take cialis everyday add cialis url cialis and manufacturer cialis muncie indiana how to stop viagra cialis spam black buy casino cialis diet followup gambling jack low online order phentermine poker post viagra cialis comparison levitra cialis online sales mexican cialis boelolokeepkidshealthycom cialis link cialis day next cialis purchase mixing cialis with effexor bulk cialis and viagra sold world wide on line cialis discount save cialis story safest of cialis levitra viagra buy cialis href newopasblogdrivecom cialis en venezuela cialis western open tee times viagra and cialis cheap buy cialis link onlinecolnu cialis europe viagra cialis submit=cialis should i buy cialis online buy cialis amsterdam cialis dose cialis tablet sildenafil cialis generico buy cialis cialisfunsurforg onlinehtml cialis drug impotence cialis testimonials sitemap1 buy cialis no prescription cialis for order cialis side effects order cialis buy cialis dreampharmaceuticals cialis drug cialis peak serum time half life pill cutters for cialis blindness cialis cialis dysfunction erectile cialis pill low cost generic cialis blogid buy casino cialis inurl order phentermine poker viagra cialis compare viagra cialis soft tabs den haag results of comparisons of viagra and cialis buy cialis in uk cialis en espanol cialis prescriptions map buy cheap cialis cialis link onlineinfo cialis cost low cialis online sale mixing viagra and cialis black buy casino cialis diet followup gambling jack order phentermine poker viagra cialis cheapest online prices cialis news information about cialis and livetra black buy casino cialis diet gambling jack online order phentermine poker tag viagra xhtml cialis class action suit cialis open ticket western order cialis online black buy casino cialis diet holdem jack online order phentermine poker tag texas viagra xhtml cialis comment info personal remember cialis order in south africa is cialis over the counter drug black casino cialis diet followup gambling health jack phentermine poker viagra cialis company cialis on line generic soft tab cialis better erections by combining cialis and viagra cialis attorney ohio cialis melt tabs how does cialis work black buy casino cheap cialis diet followup gambling health jack online order phentermine poker viagra cialis black box warnings cialis mexico online how to get best results with cialis archive buy cialis cialis discount generic cialis online purchase how viagra cialis levitra work black buy casino cialis diet followup gambling jack online order phentermine poker viagra cialis cedar park cialis mg index best cialis generic price cialis and no prescription required cialis link pharmacyrawcsorg generic cialis online best place to get totally free viagra or cialis samples cialis and venous leak