Programming 11/12: VB Assignment 5 – Lotto Generator

For this assignment, you will create a number generator for Lotto 5/20 (similar to Lotto 6/49) in which 5 numbers are randomly drawn from a set of 20. Because selection is random, each number {1, 2, 3, …, 20} has an equal chance of being drawn and the five numbers that are drawn cannot repeat. Unlike in television, the drawn numbers do not need to be sorted in ascending order; they can be presented in the order in which they are drawn. Communication of logic in the code will be emphasized.

Note: You may plan and work with a partner, but you must credit your collaborators in your code.

Evaluation: 10 marks

  • User-Level (4 marks)
    • 4: Five random numbers are generated with no repeats (unpredictable).
    • 3: Five random numbers are generated with no repeats (predictable).
    • 2: Five random numbers are generated but may repeat.
    • 1: Five numbers are not random.
    • 0: Something else is generated.
  • Code-Level (6 marks)
    • Code uses arrays. (1 mark)
    • Code can easily be adapted to other Lotto problems. (1 marks)
      • Example: Spambot program uses a variable (or constant) called MaxRepeat. By changing the value at beginning of code, it spams by the number of times indicated.
    • Logic is clearly communicated (comments, variable names, functions). (4 marks)
      • 4: Logical variable names. Bigger picture (i.e purpose, what you plan to do) and strategy (i.e. how you plan to do it).
      • 3: Unclear variable names. Bigger picture explained and strategy explained.
      • 2: Only bigger picture or strategy explained–not both.
      • 1: Few comments made.
      • 0: No comments made.