1. Goals and Scenarios

Goals: To provide and systematic analysis which can solve the problem with minimized possibility of shortcomings and balanced system interested.

In details, we set our goals at:

1)     Deign Input Interface, which allow user to input the execute command, and coefficients.

2)     Design Solution Detection unit, which can bring the coefficient to proper calculation unit.

3)     Computing Solutions, which is reusable, corresponding to different coefficients input.

4)     Design Output Interface, where presents results and proper prompts for the user.

Scenarios:

We consider the following scenarios:

 

2. Initial Use Case Modeling

Actors: Consider all things that interface with the system externally and in some way participate in the use case story. We list the following actors.

 

User: a person has a/some quadratic equation/s to solve.

Quadratic Equation/s: there are at most 3 coefficient in the equation/s

Processing unit: the facility fulfills the computation functions of the system.

Input facility: such as keyboard.

Output facility: such as monitor.

 

System Boundary:The Quadratic Equation Solver System itself is a program—a bunch of codes actually, it can read user’s input from keyboard, execute computation and output the results to screen, so the external things such as user, coefficient, input and output facilities, also, the computer.

 

Textual Use Cases

Description: the user can choose enter the equation or quit from input interface.

Primary actor: User, input facility, equation

Pre-conditions: The keyboard is installed and can work functionally. Entrance Interface 1 is designed in system.

Flow of events:

1.      Input Interface should include choices of leaving and entering.

2.      The user input coefficients.

Post-conditions: User either chooses quit to end the program, or input coefficients.

Description: the system can detect if the input is acceptable data, the number of inputs is correct.

Primary actor: equation, processing facility.

Flow of events:

1.      If user chooses entering data, under prompt, input 3 coefficients.

Post-conditions: 3 coefficients with correct format are input.

Description: when the input is reasonable, the system can store the coefficients, and classify the solution structure: extremely degenerate, degenerate, or regular.

Primary actors: equation, processing unit.

Pre-condition: The three require parameters are input correctly.

Flow of events:

1.      Set variable a, b, c equal to the coefficients input, respectively.

2.      Initialize bool variables: extremely degenerate=false, degenerate=false, regular=false.

3.      If , extremely degenerate=true.

4.      If , degenerate=true.

5.       If , regular=true

a.      If , two real solutions=true

b.      If , two complex solutions=true

 

Requirements: The input coefficients are properly stored, the system must base on a valid computer system and operation system.

 

Description: According to the classification, compute the answers.

Primary actors: equation, processing unit.

Pre-condition: when the input is stored by variables and solution structure is classified

Flow of events:

1.      Extremely degenerate=ture: no computing unit is executed.

2.      Degenerate= true:

3.      Regular=true:

a.      Two real solutions: ,

b.      Two complex solutions: ,

Post-condition: Successfully get the solution to the coefficients.

Description: Show appropriate message and

Primary actors: Processing facility, output facility

Pre-condition: Correct solution under the given coefficients are provided.

Flow of events:

1.      Output the equation itself, “Your equation is: ” a, “x2+” b, “x+”, c, “=0”

2.      Output for the case no solution is available, “No Solution”

3.      Output for the case one solution is available, “Unique solution: Root 1=”, S

4.      Output the case two solutions are available

a.  Output “Two real solutions: Root 1=”, S1, “Root 2=”, S2

b.  Output “Two complex solutions: Root 1= ”, S1, “Root 2=”, S2

 

Description: The user can choose to quit the program or start to solve another equation.

Primary actors: User, input facility

Pre-condition: Correct solution has provided, and the choices of quit and restart are given.

Flow of events:

          1. Display “Quit”, or “Calculate another equation” 

           2. If user chooses “Quit”, program will end.

          3. If user chooses “Calculate another equation”, program will re-run.

Post-condition: A status of the system is decided.

  

3. Use case diagram

3.1 INITIAL USE CASE DIAGRAM

Our initial use case diagram has four actors and six use cases. 

Use Case 1

Use Case 2

Use Case 3

Use Case 4

Use Case 5

Use Case 6

Go to system behavior model

Go to system behavior model

Go to system behavior model

Go to system behavior model

Go to system behavior model

Go to system behavior model

4. System requirements

 

1. Input interface Requirements

1.1 Key board and monitor is correctly connected to the computer, and can work properly.

1.2 Monitor can provide correct prompt, so that the user can easily read the information or instruction.1.3 Possible error information is stored and can cover most of the problem users will face, so that the user can understand what’s the possible mistake.

1.3 Input coefficients can be correctly read and stored.

 

2. Performance Requirements

Part 1: Solution Classification

2.1.1 Initialize the bool variable for the three possible solution cases: extremely degenerate, degenerate and regular case.

2.1.2 The system must be able to tell which of the three cases is applicable to this equation by compare the three coefficients with 0.

2.1.3 The bool variable for the application case can be changed to true.

Part 2: Solution Calculation

2.2.1 The system must be able to calculate the roots in three different cases

2.2.2 If the equation is an extreme degenerate case, no calculation will be excuted.

2.2.3 If the equation is a degenerate case, only one solution will be get.

2.2.4 If the equation is a regular case, it can tell the roots are complex or real.

3. Output Interface

3.1 The monitor is working properly.

3.2 The output interface can provide user the equation he/she input.

3.3 Only one case of output will be output.

3.4 If the equation is an extreme degenerate case, the output interface can show that no solution is found.

3.5 If the equation is a degenerate case, the output interface can show that there is an unique solution and the value of the root.

3.6 If the equation is a regular case, output interface can tell user whether the roots are complex or real, and the values of roots.

4. Resue System Requirements

4.1 Option of quit and reuse the program can be provided.

4.2 If user needs to solve another equation, he/she need only choose restart in the output interface.

4.3 Input interface can be provide when the user selects restart the system.

 

5. Simplified Models of System Behavior

Main Subsystems

The quadratic equation solver system has the following main subsystems:

Go to use case diagram Input Interface. The Input interface is a platform for the user to input coefficients and choose system commands.

Go to use case diagram Validation System. The system that guarantees the input coefficient are in proper format and the number of coefficients are proper.

Go to use case diagram Classification System. The system that can tell the user the equation’s solution case: extremely degenerate, degenerate or regular.

Go to use case diagram Computation System. The system that contains the computation units for each solution case.

Go to use case diagram Output Interface. The display system to show the different case of solution, error in formation and system messages.

Go to use case diagram Computer System. Provides operation platform and input, output and process facilities to the system.


 

6.  Simplified model for System Structure

The quadratic equation solver system includes four main subsystems: input interface, output interface, solution detection system and solution computation system. However, the whole system can only work under the coordination of user and computer facilities.

 

7.Logical Design

System Modules for Logical Design (Process Flow)


Gets the inputs
Check a Check bNo ansewr
Classify EquationCalculate Ansewr
Classify Equation
Calculate AnsewrCalculate Ansewr

 

7. Task interaction matrix

 

 

*Column sends, Row receives   A B C D E F
Use Case 1  Use case 1: Input interface A A         X
Use Case 2 Use case 2: Validation of coefficients input B X B        
Use Case 3 Use case 3: Classification of equation C   X C      
Use Case 4 Use case 4: Calculating roots D     X D    
Use Case 5 Use case 5: Solution output E   X X X E  
Use Case 6 Use case 6: Reuse the program F         X F

 

8. Tracability

Tracibility has been implemented using hyperlinks and book marks. The left arrow () traces back and right arrow () traces next step. Also hints assocating the hyperlinks help to trace the step.

Use Case

Scenario

Req. No.

Description

Model of System Behavior (Subsytem)

Input coefficients

 

Scenario 1.1

Req. 1.1

The input, output facilities should be correctly connected.

Input interface

Req. 1.2

The System shall provide correct prompt, so that user can read the information or instruction

Scenario 1.2

Req. 1.1

The input, output facilities should be correctly connected.

Req. 1.2

The System shall provide correct prompt, so that user can read the information or instruction

Input Validation and Error Message

Scenario 2.1

Req. 1.1

The input, output facilities should be correctly connected.

Validation system

Output interface

Scenario 2.2

Req. 1.2

The System shall provide correct prompt, so that user can read the information or instruction

Req. 1.3

Possible error information is stored.

Req. 14

Input coefficients can be correctly read and stored.

Equation Classification

 

Scenario 3.1

Req. 2.1.1

The system shall initialize three bool variables: extremely degenerate, degenerate, and regular.

Classification system

Scenario 3.3

Req. 2.1.2

The system shall be able to tell the three cases

Scenario 3.3

Req. 2.1.3

The system shall be bale to change the corresponding variable value to ‘true’, when the case is applicable.

Solution Calculation

 

Scenario 4.1

Req. 2.2.1

In each case, there is a corresponding root computing unit.

Computation system

Computer system

Req. 2.2.2

If the equation is extremely degenerate., no calculation will be executed.

Scenario 4.2

Req. 2.2.3

If the equation is degenerate, one solution can be got.

Scenario 4.3

Req. 2.2.4

If the equation is regular, system shall tell the roots are complex or real.

Req. 2.2.5

The system shall generate two complex or real roots.

Solution output

Scenario 5.1

Req. 1.1

The system shall have proper input , output facilities

Output interface

Input interface

Req. 3.1

The monitor is working properly.

Req. 3.4

The system shall provide proper information for extremely degenerate case.

Scenario 5.2

Req. 3.2

The system shall provide the equation user input.

Req. 3.5

The system shall provide proper information for degenerate case.

Scenario 5.3

Req. 3.3

The system shall only output the solution in one case.

Req. 3.6

The system shall provide proper information for degenerate case.

Reuse Control

Scenario 6.1

Req. 4.1

The system shall display reuse and quit choices

Output interface

Input interface

Scenario 6.2

Req. 4.2

The system shall be able to accept reuse control choices.

Req. 1.1

The input facility should be correctly connected.

Scenario 6.3

Req. 4.3

The system shall provide input interface when the user choose reuse the system

Req. 1.1

The input facility should be correctly connected.