-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeature-example.feature
35 lines (25 loc) · 960 Bytes
/
feature-example.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Array Sorting Exercise
Feature: Sorting of an array of grades
In order to prepare a list of grades for his class,
from the higher to the smallest,
a Teacher wants the corresponding grades sorted accordingly.
Scenario: The Teacher provides the grades for the students.
Given the list of grades [10, 9, 8, 10, 7, 9, 10]
When the Teacher capture grades one by one
And the program accumulates every grade in an array
And afther the program executes a sorting on the array elements
Then the program should return the grades in descending order like [10, 10, 10, 9, 9, 8, 7]
--------
# Analysis
Objects and classes
Actor: Teacher
Components:
ArraySortingProgram
ArrayOfNumbers
ArraySorter
InputReader
Collaborations and Relationships
ArraySortingProgram [executes] --> ArraySorter
ArraySorter [sort data of] --> ArrayOfNumbers
InputReader [read data from] --> Console
InputReader [populates] --> ArrayOfNumbers