CIS 174
LAB ASSIGNMENT #9
Assigned date: Thursday 3/26
Due date: Thursday 4/10
25 points
Lab 9.1 [8 points]
Write a program that calculates the charges for membership in a
Fitness club. The club has four membership packages to choose from: standard
adult membership, family membership, senior membership and corporate
membership. The program presents a menu that allows the user to choose the
desired package an then calculate the cost of membership. Required to use if ..
else if structure.
| Membership Packages | Monthly Cost ($) |
| Adult | 40.00 |
| Family | 80.00 |
| Senior | 20.00 |
| Corporate | 30.00 |
Sample output
Fitness Club Membership Menu
1. Standard Adult Membership
2. Family Membership
3. Senior Membership
4. Corporate Membership
5. Exit
Enter your choice: 2
For how many months: 12
The total charges are $ 960.00
Hint: char choice = input.charAt(0);
Lab 9.2 [8 points]
Write a program that uses nested loop to
display the following pattern:
A
AA
AAA
AAAA
AAAAA
AAAAAA
AAAAAAA
AAAAAAAA
AAAAAAAA
AAAAAAA
AAAAAA
AAAAA
AAAA
AAA
AA
A
Lab 9.3 [9 points]
Write a program that asks the user to enter the number of videos rented. The program then calculates and displays the charges for video rentals. Every third video is free. The charge for current releases is $3.50; other videos are $2.50.
Output sample1
How many videos are being rented? 5
Is video #1 a current release? (Y/N) y
Is video #2 a current release? (Y/N) y
Video #3 is free!
Is video #4 a current release? (Y/N) n
Is video #5 a current release? (Y/N) y
The total is $13.00
Output sample 2
How many videos are being rented? 7
Is video #1 a current release? (Y/N) y
Is video #2 a current release? (Y/N) y
Video #3 is free!
Is video #4 a current release? (Y/N) n
Is video #5 a current release? (Y/N) y
Video #6 is free!
Is video #7 a current release? (Y/N) n
The total is $15.50
.