These activities are to make you practice more and are not graded! Implementation Guidelines:
- Students work in pairs or individually
- Each activity should take 10-15 minutes
- Encourage creativity and additional features
Problem 1: ATM
Create a program that:
- Starts with a balance of 1000
- Shows menu options (check balance, withdraw, deposit)
- Updates balance after transactions
- Prevents overdraft (balance < 0)
- Continues until user chooses to exit
Problem 2: Count Characters
Create a program that:
- Accepts a sentence from user
- Counts total characters (excluding spaces)
- Counts total words
- Displays statistics (total characters excluding spaces and total words)
Problem 3: Grade Calculator
Create a program that:
- Accepts assignment scores (
tests
,homework
,projects
) from users in the terminal
- where each of these assignment is calculated with it’s weighting factor
- For example, you are given that the weighting factor for
tests is 20%
,homework is 20%
, andprojects is 30%
.
- Calculates weighted average of the assignment scores
- Show the current numeric grade which is the weighted average.
- If the weighted average score is less than
50%
, warn the student to prepare hard for the final exam in order not to fail the class - Calculates what score is needed on final exam for a potential desired grade of
A
which must be>=90
scores - Optional: Convert numerical grades to letter grades where
>= 90 is A, >= 80 is B, >= 70 is C, >= 60 is D, and < 60 is F