DEV Community

Mini Software Project using SDLC (Calculator App)

  1. Requirement Analysis

Objective: Build a simple calculator that can perform basic arithmetic operations.

Functional Requirements:

User should be able to input two numbers.

App should support addition, subtraction, multiplication, and division.

Display result clearly.

Non-functional Requirements:

Simple, fast, and user-friendly interface.

Should handle invalid inputs (e.g., division by zero).

2. Design (with Wireframe/Sketch)
Wireframe (UI Design):

+---------------------------+
|      Simple Calculator    |
+---------------------------+
|   [   Input Box 1    ]    |
|   [   Input Box 2    ]    |
+---------------------------+
| [ + ] [ - ] [ × ] [ ÷ ]   |
+---------------------------+
|       Result: ____        |
+---------------------------+
Enter fullscreen mode Exit fullscreen mode

Two input fields for numbers.

Four buttons for operations.

A result display area.

3. Development (Pseudocode)

Start
  Display "Enter two numbers"
  Read num1, num2
  Display menu: 1.Add 2.Subtract 3.Multiply 4.Divide
  Read choice
  If choice = 1 → result = num1 + num2
  If choice = 2 → result = num1 - num2
  If choice = 3 → result = num1 * num2
  If choice = 4 
       If num2 != 0 → result = num1 / num2
       Else → Print "Error: Division by zero"
  Display result
End
Enter fullscreen mode Exit fullscreen mode

4. Testing Plan

| **Test Case ID** | **Description**               | **Input** | **Expected Output** | **Status** |
| ---------------- | ----------------------------- | --------- | ------------------- | ---------- |
| TC-01            | Addition                      | 5, 3, +   | 8                   | Pass       |
| TC-02            | Subtraction                   | 9, 4, -   | 5                   | Pass       |
| TC-03            | Multiplication                | 6, 7, ×   | 42                  | Pass       |
| TC-04            | Division                      | 8, 2, ÷   | 4                   | Pass       |
| TC-05            | Division by Zero              | 5, 0, ÷   | Error message shown | Pass       |
| TC-06            | Invalid Input (e.g., letters) | A, 3, +   | Error message shown | Pass       |

Enter fullscreen mode Exit fullscreen mode

✅ Final Notes (for exam writing):

Keep answer short and structured.

Draw a simple calculator sketch.

Show pseudocode clearly.

Include at least 4–5 test cases.

Top comments (0)