Test 1 Preparation

Problem 1 (90 points):

Write a function: validPlate that has one parameter - string of characters. The function returns True if the string is a valid Car License Plate in some State in USA, and False otherwise.

The rules for the valid license plate are:

  1. Length must be 7 characters
  2. Must be combination of upper case letters and digits ONLY
  3. The plate must include at least one letter
  4. Combinations that consist of six numbers followed by one letter are NOT VALID.
  5. Use of the letter "I" as the first or/and last characters on a plate when the other characters are all numbers are NOT VALID.

For example:

YANa1234 - NOT VALID (has lower case letter)

I12345I - NOT VALID (has letter "I" as first and last and other chars are all digits)

1234567 - NOT VALID (doesn't have any letters)

123456A - NOT VALID (6 numbers followed by one letter is not permitted)

123A456 - VALID

123I3I6 - VALID

YANA-123 - NOT VALID (has special char)

IA3B4CI - VALID

I123456 - NOT VALID (has letter "I" as first and all other digits)

123456I - NOT VALID (has letter "I" as last and all other digits)

Write main to test your function. In my examples I indicated the reason for validity/not validity. That was done for explanation purposes only. Your program doesn't need to explain the reason for validity/not validity.

Problem 2 (10 points):

Write a program that randomly generates a list of integers. The program finds an average of the list elements and creates two lists: list of all numbers above average from original list and list of all numbers below average from original list.

Design: