Calculator Requirements pada Perancangan Perangkat Lunak

4
Four Function Calculator Requirement Specification 1 Four Function Calculator Requirement Specification 1. Introduction This document describes the behavior of a simple four-function calculator application intended for use on both Windows and Macintosh personal computers. The application will model the behavior of a standard four-function pocket calculator as closely as possi- ble. 2. Environment characteristics 2.1. Hardware The application should run on both IBM-compatible and Macintosh hardware. 2.2. Operating System While no information about particular operating systems was provided by the client, we assume that the application should run on the most recent end-user versions of the primary operating systems for each hardware platform. For the IBM-compatible system, this is Windows 98. For the Macintosh, this is MacOS 8.5. 2.3. User expertise The client is an experienced computer user. We therefore assume that users will have basic knowledge of using the mouse and keyboard, along with the typical text editing conven- tions for the two platforms mentioned in section 2.2 3. Input/Output and System Modes 3.1. Data input We assume that data input will occur only via the keyboard and the mouse. Entry of a numeric quantity via either of these methods is terminated by clicking a button represent- ing an operation. 3.2. Data output 3.2.1. Output display All output will appear in a text display area similar to a calculator’s LCD screen. 3.2.2. Output events Clicking a button representing an operation causes the display area to be updated. Results will be presented to at most ten decimal places accuracy.

description

Requirements yang dibutuhkan aplikasi calculator pada matakuliah Perancangan Perangkat Lunak (PPL)

Transcript of Calculator Requirements pada Perancangan Perangkat Lunak

Page 1: Calculator Requirements pada Perancangan Perangkat Lunak

Results

Four Function Calculator Requirement Specification

1. Introduction

This document describes the behavior of a simple four-function calculator application intended for use on both Windows and Macintosh personal computers. The application will model the behavior of a standard four-function pocket calculator as closely as possi-ble.

2. Environment characteristics

2.1. HardwareThe application should run on both IBM-compatible and Macintosh hardware.

2.2. Operating SystemWhile no information about particular operating systems was provided by the client, we assume that the application should run on the most recent end-user versions of the primary operating systems for each hardware platform. For the IBM-compatible system, this is Windows 98. For the Macintosh, this is MacOS 8.5.

2.3. User expertiseThe client is an experienced computer user. We therefore assume that users will have basic knowledge of using the mouse and keyboard, along with the typical text editing conven-tions for the two platforms mentioned in section 2.2

3. Input/Output and System Modes

3.1. Data inputWe assume that data input will occur only via the keyboard and the mouse. Entry of a numeric quantity via either of these methods is terminated by clicking a button represent-ing an operation.

3.2. Data output

3.2.1. Output displayAll output will appear in a text display area similar to a calculator’s LCD screen.

3.2.2. Output eventsClicking a button representing an operation causes the display area to be updated. will be presented to at most ten decimal places accuracy.

Four Function Calculator Requirement Specification 1

Page 2: Calculator Requirements pada Perancangan Perangkat Lunak

e f the

use f the

entry

e f the

3.2.3. Exporting output dataThe data in the display area may be selected and copied for pasting into other applications.

4. Software functions

4.1. Number entryThe application will present a visual keypad where one digit at a time can be added to the display by using the mouse to select one of the digit buttons. An optional negative sign can be entered before any digits have been entered; thereafter, the negative button will be ignored. As long as an operation has not been requested, digits will be added to the right-hand side of the current number. This number will be displayed in the display area as it is composed. Number entry restarts after any arithmetic operation, result display, value stor-age, or clear operation is requested.

4.2. Number formattingNumbers will be displayed to ten digits accuracy. They may include a decimal point (which is not counted against the ten digits) and an optional leading negative sign.

4.3. Arithmetic OperationsOperations are represented by buttons on the calculator which specify the arithmetic oper-ation to perform or the storage of a value for future recall. In general, the entry of a num-ber is terminated by clicking on one of the operation buttons.

4.3.1. AdditionClicking on the addition button, which will be marked with the character “+,” will causthe current contents of the display area to be “remembered,” and will allow the entry onext number to begin.

4.3.2. SubtractionClicking on the subtraction button, which will be marked with the character “-,” will cathe current contents of the display area to be “remembered,” and will allow the entry onext number to begin.

4.3.3. MultiplicationClicking on the multiplication button, which will be marked with the character “*,” willcause the current contents of the display area to be “remembered,” and will allow theof the next number to begin.

4.3.4. DivisionClicking on the addition button, which will be marked with the character “/,” will causthe current contents of the display area to be “remembered,” and will allow the entry onext number to begin.

Four Function Calculator Requirement Specification 2

Page 3: Calculator Requirements pada Perancangan Perangkat Lunak

en value lay.

entry

he ber

ill ction ed

resets s been

sting

r an

f a ms

4.4. Display resultThe display result operation is requested by clicking on the “=” key. If a value has be“remembered” by requesting one of the arithmetic operations, then the rememberedis combined according to the requested operation with the value currently in the dispThe display is updated with the new value, and the calculator is made ready for the of the next number.

4.5. Value memoryThe calculator will allow one value to be stored for later recall.

4.5.1. Store valueA value is stored in memory by clicking on the button labelled “Store.” This causes tvalue that is currently displayed to be copied to the storage location. This resets numentry, so any digits that are subsequently typed will erase the displayed value.

4.5.2. Recall valueIf a value is currently stored in the storage location, clicking on the “Recall” button wreplace the displayed value with a copy of the value from the storage location. This aresets number entry, so any digits that are subsequently typed will erase the displayvalue.

4.6. ClearClicking on the “Clear” button erases any value that appears in the display area andnumber entry. Clear does not affect the “remembered” value or the operation that harequested.

4.7. Data exportThe application should allow the value in the display to be selected and copied for painto other applications. It will not support values being pasted into the display.

5. Constraints and goals

5.1. PortabilityThe application should be implemented in such a way that it can be used from eitheIBM-compatible or Macintosh personal computer.

5.2. UsabilityThe interface of the calculator should be as close to the appearance and operation ophysical calculator as possible. The appearance of the application on the two platforshould be a close to identical as possible.

Four Function Calculator Requirement Specification 3

Page 4: Calculator Requirements pada Perancangan Perangkat Lunak

R” in

n char-ssage

ut-

d

lue

either

6. Response to undesired events

6.1. Division by zeroIf the user requests division by zero, the application should put the message “ERROthe display area and reset number entry.

6.2. Invalid value imported by pastingIf the user pastes a value into the display area which is longer than ten digits plus aoptional negative sign and decimal point, or if the user pastes a value which containsacters which are not digits into the display area, the calculator should display the me“ERROR” and reset number entry.

7. Life cyle considerations

7.1. Subsets

1. Basic calculation - entering two numbers and calculating a result. The “Clear” bton should also work in this subset.

2. Store and recall - in addition to the basic calculation functions, allow storage anrecall of one value.

3. Accept pasted values - in addition to the basic calculation functions, allow a vacopied from another application to be pasted into the display area.

Note that subsets 2 and 3 are essentially independent and could be implemented inorder.

7.2. Fundamental assumptionsNone.

7.3. Potential Changes

1. Other functions may be added.

2. The number of digits displayed may be expanded.

3. Other display formats, such as scientific notation, may be added.

4. Copying of results for pasting into other applications may be added.

5. The number of stored values may be expanded.

6. The visual appearance of the calculator may be updated.

Four Function Calculator Requirement Specification 4