My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
RandomBuddy  
Description of the Random Buddy Generator feature
Updated Feb 4, 2010 by akf.flo...@gmail.com

User Level Definition

Brainiac will allow the user to randomly select a Study Buddy to play with from the entire collection. This feature chooses a Study Buddy at random, then asks the user if he/she wants to play with the selected Buddy. If not, another Buddy may be selected, also randomly.

System Level Specification

Function: Randomly choose a Study Buddy

Description: The system keeps tracks of the set of all available Study Buddies. The Random Buddy Generator chooses one Buddy from this set for the user to play.

Input: Set of all identifiers representing all the available Study Buddies

Source: Data structures within the software.

Output: One identifier representing one Study Buddy

Action: Each available Study Buddy is assigned a unique identifier (i.e. an int). An array or some other type of data structure stores all the identifiers. The Random Buddy Generator selects an identifier from the set using the Java class "Random". The corresponding Study Buddy is then presented to the user, and he/she is prompted to confirm that he/she wants to play the selected Buddy.

Pre-condition: There must be more than one Study Buddy.

Post-condition: A value is assigned to a variable of type Random. This variable stores the identifier of the randomly chosen Study Buddy.

Powered by Google Project Hosting