Lab 3
- Problem 1: In this program you will check the expiration year of
the prodcuts and create a list of expired, about to expire and still good
items.
Write a program that reads a sequence of integers, each integer represents
the expiration year. Store the data in one dimensional list. The program
will ask to enter current year. The program then will check expiration
dates on all items and create three different lists: expired (expiration
year < current year),
about_to_expire (items with the expiration year equals to current year),
still_good. The program prints the sizes of each category
and the values in each category.
Use top-down design: write a separate function for each task: make_list,
separate_list
- Problem 2: Write a program that randomly generates the list of
graduation years for the students who is currently enrolled in high school.
Assuming, the high school is 4 year institution, finds the number of
freshmans, sophomores, juniors, and seniors in school
- Problem 3: Write a program that generates a list of student's GPAs.
The Honors program requires GPA to be 3.5 or above. The program will
create two new lists: Honors and Regular. Honors will include all GPA
that are eligible for the Honors program and Regular will include the
rest.
- Problem
4: Write a program that reads a string and finds the number of
special characters in the string.
- Problem 5: Write a program that reads one string. Creates
a list from
the input string. The program replaces all lower case chars with upper
case chars in the list and then creates a new string from the edited list.
Pay attention: you cannot change the chars in the string