Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Outline
- I) Elements
- A) Operation Outline
- 1) Program Initialization
- a) Function Declarations
- 1) avg
- def avg(*args)
- b) Variable Declarations
- 1) Declared Simplest
- a) testA -1
- b) testB -1
- c) testC -1
- d) average 0
- 2) Intuitive
- a) tests [-1, -1, -1]
- b) average 0
- 3) Optimal
- a) tests []
- b) average 0
- 2) Main
- a) Window Creation
- b) User Input Loop Loop user input request event until winclose state
- c) WinClose State Data set full or declared full
- d) Data Validation Data set checked for expected input type(s), converted to standard type (float)
- f) Data Manipulation Average of test scores calculated
- 3) Exit
- a) Window Creation
- b) Program Output Average of test scores displayed
- B) Data
- 1) Requirements
- a) Declared Three test scores entered as percentages (E.g. 34%) entered to unspecified precision.
- b) Optimal n test scores entered as any common representation of percentages (E.g. 34%, 34.00%, 0.34) of any precision
- 2) Acquisition Methods ** Undeclared Prompt Type: Assumed prompt type Pop-up Window Input Box
- **
- a) Simplest Repetitive windows acquiring requested data set individually
- 1) Limitations
- A) Unintuitive Inexperienced users will struggle with understanding the significance of each separate but indentical window.
- Solution is make each visually unique.
- B) Mistaken Data Entry. All users will occasionally enter mistaken data and be unable to edit.
- Solution is final checks window with options to edit. Defeats purpose of this method when compared to the intuitive method as this solution is baked in by default.
- 2) Advantage
- A) Simplest to implement Method requires smallest count of lines of code to implement applicable function.
- B) Limitless Data Sets For optimal data requirements, method allows data sets larger or smaller than predicted when cancelled or data deviates from expected input type(s).
- b) Intuitive Single window with required boxes directly specifying required data set.
- 1) Limitations
- A) Speed Method directly sacrifices speed of operation for experienced users to accomodate more inexperienced users. Has smaller learning curve, but less ability for power-users.
- Solution is bake in power-user functionality, such as field tabbing. Abscence does not limit full functionality of method.
- B) Unflexible Method does not allow for inputted data set's entry count to be larger than the count of available input boxes (E.g. 3 input boxes limits data set to 3)
- Solution is only to predict the required data set size and build accordingly.
- 2) Advantage
- A) Utility Method directly bakes in functionality missing from other methods in the form of user-verifiable data.
- c) Optimal Smart window that accepts data set inputted as delineated array or individual data points, disappearing only when required data set acquired, or specified to stop acquisition.
- 1) Limitations
- A) Unintuitive Inexperienced users will struggle with understanding the significance of each separate but indentical window.
- Solution is make each visually unique.
- B) Learning Curve Inexperienced users will struggle with learning and using power-user functionality (E.g. Delineated array entry)
- Solution is include instruction information in window.
- 2) Advantage
- A) Functionality Method allows for most flexible entry method.
- 3) Validation Validating the supplied data to ensure compliance with expect input type(s)
- a) Numerical Statistics
- 1) Real Domain: [0, ∞] Test scores can be higher than 100.00% in specific circumstances. This domain is unreasonable due to the limited precision of large numbers represented in binary exponential notation.
- 2) Ideal Domain: [0, 2] Test scores can be higher than 100.00% in specific circumstances. This domain is ideal due to the implicit inclusion of test scores > 100%.
- 3) Preferred Domain: [0, 1] Vast majority of test scores will fall inside this range. This domain is most reasonable. Does not allow for test scores of larger than 100.00%.
- Easiest to determine if value entered and value interpreted are identical.
- 4) Literal Domain: [-1, 1] -1 value represents null or unentered value in this context and thus is a way to identify missing data points in declared data sets.
- In strict languages without 'undeclared' or 'null' values, this is the itialized value for variables. Values -1 < x < 0 are all considered to be null.
- b) Type-Checking
- 1) Expected Types
- A) Strings (E.g. 34%)
- B) Numeric (E.g. 0.34)
- c) Data Error Solutions by Type
- 1) Entered data not matching type-check requirements
- A) Re-request Data
- B) Discard mismatch
- d) Type-Conversion
- 1) Convert Strings (E.g. 34% -> 0.34) to Decimal based numeric representation by removing '%' and divide remaining numbers by 100.
- 4) Storage
- a) Declared Simplest Named variable names (E.g. testA, testB, testC)
- b) Declared Preferred Named array variable with initialized with null literals (-1) for all three values. Data acquisition saves sequentially to array.
- c) Optimal Named array variable with single initialized value that expands dynamically as data is added to the set.
- 5) Manipulation
- a) Take data set and output average.
- 1) Declared Simplest
- return testA + testB + testC / 3
- 2) Optimal
- average = 0
- for element in array
- average += array[element]
- average /= len(array)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement