Week 4 Assignments
Variant 1: Gym Performance Tracker
Problem Statement: Create a gym performance tracking system that analyzes workout sessions and provides personalized feedback. Your program should:
- Define a function
calculate_calories_burned(exercise_type, duration_minutes, intensity)that:- For “cardio”: burns 8 calories/minute at low intensity, 12 at medium, 16 at high
- For “strength”: burns 6 calories/minute at low intensity, 9 at medium, 12 at high
- For “flexibility”: burns 3 calories/minute at low intensity, 5 at medium, 7 at high
- Return the total calories burned
- Define a function
calculate_heart_rate_zone(age, resting_hr, exercise_hr)that:- Calculate max heart rate: 220 - age
- Calculate heart rate reserve: max_hr - resting_hr
- Calculate intensity percentage: (exercise_hr - resting_hr) / heart_rate_reserve * 100
- Return the intensity percentage
- Define a function
determine_training_zone(intensity_percent)that:- Below 50%: “Warm-up Zone”
- 50-60%: “Fat Burn Zone”
- 60-70%: “Cardio Zone”
- 70-85%: “Performance Zone”
- Above 85%: “Maximum Effort Zone”
- Define a function
calculate_workout_score(calories, duration, zone_multiplier)that:- Base score = calories * 0.1 + duration * 2
- Zone multipliers: Warm-up=0.5, Fat Burn=1.0, Cardio=1.2, Performance=1.5, Maximum=1.8
- Return the final score rounded to 1 decimal place
- Define a function
needs_rest_day(consecutive_days, total_minutes, avg_intensity)that:- Returns True if consecutive_days >= 6
- Returns True if total_minutes > 450 AND avg_intensity > 70
- Returns True if consecutive_days >= 4 AND avg_intensity > 80
- Otherwise returns False
- Define a function
generate_workout_report(name, exercise_type, duration, intensity, age, resting_hr, exercise_hr, consecutive_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these workout sessions:
- Session 1: “Alex”, “cardio”, 45 minutes, “high”, age=28, resting_hr=65, exercise_hr=155, consecutive_days=3
- Session 2: “Jordan”, “strength”, 60 minutes, “medium”, age=35, resting_hr=70, exercise_hr=140, consecutive_days=5
- Session 3: “Casey”, “flexibility”, 30 minutes, “low”, age=42, resting_hr=68, exercise_hr=95, consecutive_days=7
Expected Output
FITNESS PERFORMANCE TRACKER
========================================
Workout Report for: Alex
----------------------------------------
Exercise Type: cardio
Duration: 45 minutes
Intensity Level: high
Calories Burned: 720
Heart Rate Analysis:
Age: 28, Resting HR: 65, Exercise HR: 155
Intensity: 70.9%
Training Zone: Performance Zone
Workout Score: 243.0
Consecutive Training Days: 3
Rest Day Recommended: No
========================================
Workout Report for: Jordan
----------------------------------------
Exercise Type: strength
Duration: 60 minutes
Intensity Level: medium
Calories Burned: 540
Heart Rate Analysis:
Age: 35, Resting HR: 70, Exercise HR: 140
Intensity: 60.9%
Training Zone: Cardio Zone
Workout Score: 208.8
Consecutive Training Days: 5
Rest Day Recommended: No
========================================
Workout Report for: Casey
----------------------------------------
Exercise Type: flexibility
Duration: 30 minutes
Intensity Level: low
Calories Burned: 90
Heart Rate Analysis:
Age: 42, Resting HR: 68, Exercise HR: 95
Intensity: 24.5%
Training Zone: Warm-up Zone
Workout Score: 34.5
Consecutive Training Days: 7
Rest Day Recommended: Yes
Variant 2: Sports Training Analyzer
Problem Statement: Create a sports training analysis system that evaluates athletic performance and provides coaching feedback. Your program should:
- Define a function
calculate_energy_expended(activity_type, duration_minutes, intensity)that:- For “running”: expends 10 calories/minute at low intensity, 14 at medium, 18 at high
- For “cycling”: expends 7 calories/minute at low intensity, 11 at medium, 15 at high
- For “swimming”: expends 9 calories/minute at low intensity, 13 at medium, 17 at high
- Return the total energy expended
- Define a function
calculate_performance_intensity(age, baseline_hr, training_hr)that:- Calculate max heart rate: 220 - age
- Calculate heart rate reserve: max_hr - baseline_hr
- Calculate intensity percentage: (training_hr - baseline_hr) / heart_rate_reserve * 100
- Return the intensity percentage
- Define a function
determine_effort_level(intensity_percent)that:- Below 50%: “Recovery Level”
- 50-60%: “Endurance Level”
- 60-70%: “Aerobic Level”
- 70-85%: “Threshold Level”
- Above 85%: “Peak Power Level”
- Define a function
calculate_training_points(energy, duration, level_bonus)that:- Base points = energy * 0.1 + duration * 2
- Level bonuses: Recovery=0.5, Endurance=1.0, Aerobic=1.2, Threshold=1.5, Peak=1.8
- Return the final points rounded to 1 decimal place
- Define a function
requires_recovery(training_days, total_minutes, avg_intensity)that:- Returns True if training_days >= 6
- Returns True if total_minutes > 450 AND avg_intensity > 70
- Returns True if training_days >= 4 AND avg_intensity > 80
- Otherwise returns False
- Define a function
generate_training_summary(athlete, activity_type, duration, intensity, age, baseline_hr, training_hr, training_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted summary (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these training sessions:
- Session 1: “Sam”, “running”, 45 minutes, “high”, age=28, baseline_hr=65, training_hr=155, training_days=3
- Session 2: “Morgan”, “cycling”, 60 minutes, “medium”, age=35, baseline_hr=70, training_hr=140, training_days=5
- Session 3: “Taylor”, “swimming”, 30 minutes, “low”, age=42, baseline_hr=68, training_hr=95, training_days=7
Expected Output
SPORTS TRAINING ANALYZER
========================================
Training Summary for: Sam
----------------------------------------
Activity Type: running
Duration: 45 minutes
Intensity Level: high
Energy Expended: 810
Performance Analysis:
Age: 28, Baseline HR: 65, Training HR: 155
Intensity: 70.9%
Effort Level: Threshold Level
Training Points: 256.5
Consecutive Training Days: 3
Recovery Day Required: No
========================================
Training Summary for: Morgan
----------------------------------------
Activity Type: cycling
Duration: 60 minutes
Intensity Level: medium
Energy Expended: 660
Performance Analysis:
Age: 35, Baseline HR: 70, Training HR: 140
Intensity: 60.9%
Effort Level: Aerobic Level
Training Points: 223.2
Consecutive Training Days: 5
Recovery Day Required: No
========================================
Training Summary for: Taylor
----------------------------------------
Activity Type: swimming
Duration: 30 minutes
Intensity Level: low
Energy Expended: 270
Performance Analysis:
Age: 42, Baseline HR: 68, Training HR: 95
Intensity: 24.5%
Effort Level: Recovery Level
Training Points: 43.5
Consecutive Training Days: 7
Recovery Day Required: Yes
Variant 3: Exercise Program Monitor
Problem Statement: Create an exercise program monitoring system that tracks physical activity and provides health guidance. Your program should:
- Define a function
calculate_kilojoules_used(workout_type, duration_minutes, intensity)that:- For “aerobic”: uses 35 kilojoules/minute at low intensity, 50 at medium, 65 at high
- For “resistance”: uses 25 kilojoules/minute at low intensity, 38 at medium, 50 at high
- For “yoga”: uses 12 kilojoules/minute at low intensity, 20 at medium, 28 at high
- Return the total kilojoules used
- Define a function
calculate_exertion_level(age, rest_pulse, active_pulse)that:- Calculate max heart rate: 220 - age
- Calculate heart rate reserve: max_hr - rest_pulse
- Calculate intensity percentage: (active_pulse - rest_pulse) / heart_rate_reserve * 100
- Return the intensity percentage
- Define a function
determine_activity_zone(intensity_percent)that:- Below 50%: “Light Activity”
- 50-60%: “Moderate Activity”
- 60-70%: “Vigorous Activity”
- 70-85%: “Hard Activity”
- Above 85%: “Maximum Activity”
- Define a function
calculate_fitness_rating(kilojoules, duration, zone_factor)that:- Base rating = kilojoules * 0.024 + duration * 2
- Zone factors: Light=0.5, Moderate=1.0, Vigorous=1.2, Hard=1.5, Maximum=1.8
- Return the final rating rounded to 1 decimal place
- Define a function
should_take_break(active_days, total_minutes, avg_intensity)that:- Returns True if active_days >= 6
- Returns True if total_minutes > 450 AND avg_intensity > 70
- Returns True if active_days >= 4 AND avg_intensity > 80
- Otherwise returns False
- Define a function
generate_activity_analysis(participant, workout_type, duration, intensity, age, rest_pulse, active_pulse, active_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted analysis (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these exercise sessions:
- Session 1: “Robin”, “aerobic”, 45 minutes, “high”, age=28, rest_pulse=65, active_pulse=155, active_days=3
- Session 2: “Jamie”, “resistance”, 60 minutes, “medium”, age=35, rest_pulse=70, active_pulse=140, active_days=5
- Session 3: “Avery”, “yoga”, 30 minutes, “low”, age=42, rest_pulse=68, active_pulse=95, active_days=7
Expected Output
EXERCISE PROGRAM MONITOR
========================================
Activity Analysis for: Robin
----------------------------------------
Workout Type: aerobic
Duration: 45 minutes
Intensity Level: high
Kilojoules Used: 2925
Exertion Analysis:
Age: 28, Rest Pulse: 65, Active Pulse: 155
Intensity: 70.9%
Activity Zone: Hard Activity
Fitness Rating: 240.3
Consecutive Active Days: 3
Break Day Needed: No
========================================
Activity Analysis for: Jamie
----------------------------------------
Workout Type: resistance
Duration: 60 minutes
Intensity Level: medium
Kilojoules Used: 2280
Exertion Analysis:
Age: 35, Rest Pulse: 70, Active Pulse: 140
Intensity: 60.9%
Activity Zone: Vigorous Activity
Fitness Rating: 209.7
Consecutive Active Days: 5
Break Day Needed: No
========================================
Activity Analysis for: Avery
----------------------------------------
Workout Type: yoga
Duration: 30 minutes
Intensity Level: low
Kilojoules Used: 360
Exertion Analysis:
Age: 42, Rest Pulse: 68, Active Pulse: 95
Intensity: 24.5%
Activity Zone: Light Activity
Fitness Rating: 34.3
Consecutive Active Days: 7
Break Day Needed: Yes
Variant 4: Retail Sales Performance System
Problem Statement: Create a retail sales performance system that analyzes sales data and provides commission calculations. Your program should:
- Define a function
calculate_revenue_generated(product_category, units_sold, price_tier)that:- For “electronics”: generates $45/unit at low tier, $75 at medium, $120 at high
- For “clothing”: generates $25/unit at low tier, $40 at medium, $65 at high
- For “accessories”: generates $15/unit at low tier, $25 at medium, $35 at high
- Return the total revenue generated
- Define a function
calculate_performance_ratio(experience_years, baseline_sales, actual_sales)that:- Calculate expected sales: 1000 + (experience_years * 100)
- Calculate sales capacity: expected_sales - baseline_sales
- Calculate performance percentage: (actual_sales - baseline_sales) / sales_capacity * 100
- Return the performance percentage
- Define a function
determine_achievement_level(performance_percent)that:- Below 50%: “Developing Level”
- 50-60%: “Competent Level”
- 60-70%: “Proficient Level”
- 70-85%: “Advanced Level”
- Above 85%: “Expert Level”
- Define a function
calculate_commission_earned(revenue, units, level_multiplier)that:- Base commission = revenue * 0.05 + units * 2
- Level multipliers: Developing=0.5, Competent=1.0, Proficient=1.2, Advanced=1.5, Expert=1.8
- Return the final commission rounded to 1 decimal place
- Define a function
needs_training_support(consecutive_months, total_units, avg_performance)that:- Returns True if consecutive_months >= 6 AND avg_performance < 50
- Returns True if total_units < 100 AND avg_performance < 60
- Returns True if consecutive_months >= 4 AND avg_performance < 40
- Otherwise returns False
- Define a function
generate_sales_report(employee, product_category, units, price_tier, experience_years, baseline_sales, actual_sales, consecutive_months)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these sales records:
- Record 1: “Blake”, “electronics”, 45 units, “high”, experience=3, baseline_sales=800, actual_sales=1150, consecutive_months=3
- Record 2: “Dana”, “clothing”, 60 units, “medium”, experience=5, baseline_sales=900, actual_sales=1300, consecutive_months=5
- Record 3: “Finley”, “accessories”, 30 units, “low”, experience=8, baseline_sales=850, actual_sales=950, consecutive_months=7
Expected Output
RETAIL SALES PERFORMANCE SYSTEM
========================================
Sales Report for: Blake
----------------------------------------
Product Category: electronics
Units Sold: 45
Price Tier: high
Revenue Generated: $5400
Performance Analysis:
Experience: 3 years, Baseline: 800, Actual Sales: 1150
Performance: 70.0%
Achievement Level: Advanced Level
Commission Earned: $540.0
Consecutive Months: 3
Training Support Needed: No
========================================
Sales Report for: Dana
----------------------------------------
Product Category: clothing
Units Sold: 60
Price Tier: medium
Revenue Generated: $2400
Performance Analysis:
Experience: 5 years, Baseline: 900, Actual Sales: 1300
Performance: 66.7%
Achievement Level: Proficient Level
Commission Earned: $288.0
Consecutive Months: 5
Training Support Needed: No
========================================
Sales Report for: Finley
----------------------------------------
Product Category: accessories
Units Sold: 30
Price Tier: low
Revenue Generated: $450
Performance Analysis:
Experience: 8 years, Baseline: 850, Actual Sales: 950
Performance: 10.5%
Achievement Level: Developing Level
Commission Earned: $41.2
Consecutive Months: 7
Training Support Needed: Yes
Variant 5: Restaurant Service Analyzer
Problem Statement: Create a restaurant service analysis system that evaluates server performance and calculates gratuities. Your program should:
- Define a function
calculate_sales_amount(meal_type, table_count, service_level)that:- For “breakfast”: generates $30/table at low level, $45 at medium, $60 at high
- For “lunch”: generates $40/table at low level, $65 at medium, $90 at high
- For “dinner”: generates $55/table at low level, $85 at medium, $125 at high
- Return the total sales amount
- Define a function
calculate_efficiency_score(shift_years, standard_tables, served_tables)that:- Calculate expected tables: 1000 + (shift_years * 100)
- Calculate table capacity: expected_tables - standard_tables
- Calculate efficiency percentage: (served_tables - standard_tables) / table_capacity * 100
- Return the efficiency percentage
- Define a function
determine_service_rating(efficiency_percent)that:- Below 50%: “Learning Stage”
- 50-60%: “Capable Stage”
- 60-70%: “Skilled Stage”
- 70-85%: “Accomplished Stage”
- Above 85%: “Master Stage”
- Define a function
calculate_tip_earnings(sales, tables, rating_bonus)that:- Base tips = sales * 0.05 + tables * 2
- Rating bonuses: Learning=0.5, Capable=1.0, Skilled=1.2, Accomplished=1.5, Master=1.8
- Return the final tips rounded to 1 decimal place
- Define a function
requires_mentoring(service_weeks, total_tables, avg_efficiency)that:- Returns True if service_weeks >= 6 AND avg_efficiency < 50
- Returns True if total_tables < 100 AND avg_efficiency < 60
- Returns True if service_weeks >= 4 AND avg_efficiency < 40
- Otherwise returns False
- Define a function
generate_service_summary(server, meal_type, tables, service_level, shift_years, standard_tables, served_tables, service_weeks)that:- Calls all necessary functions to calculate metrics
- Prints a formatted summary (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these service records:
- Record 1: “Quinn”, “dinner”, 45 tables, “high”, shift_years=3, standard_tables=800, served_tables=1150, service_weeks=3
- Record 2: “Reese”, “lunch”, 60 tables, “medium”, shift_years=5, standard_tables=900, served_tables=1300, service_weeks=5
- Record 3: “Skyler”, “breakfast”, 30 tables, “low”, shift_years=8, standard_tables=850, served_tables=950, service_weeks=7
Expected Output
RESTAURANT SERVICE ANALYZER
========================================
Service Summary for: Quinn
----------------------------------------
Meal Type: dinner
Tables Served: 45
Service Level: high
Sales Amount: $5625
Efficiency Analysis:
Experience: 3 years, Standard: 800, Served Tables: 1150
Efficiency: 70.0%
Service Rating: Accomplished Stage
Tip Earnings: $556.9
Service Weeks: 3
Mentoring Required: No
========================================
Service Summary for: Reese
----------------------------------------
Meal Type: lunch
Tables Served: 60
Service Level: medium
Sales Amount: $3900
Efficiency Analysis:
Experience: 5 years, Standard: 900, Served Tables: 1300
Efficiency: 66.7%
Service Rating: Skilled Stage
Tip Earnings: $378.0
Service Weeks: 5
Mentoring Required: No
========================================
Service Summary for: Skyler
----------------------------------------
Meal Type: breakfast
Tables Served: 30
Service Level: low
Sales Amount: $900
Efficiency Analysis:
Experience: 8 years, Standard: 850, Served Tables: 950
Efficiency: 10.5%
Service Rating: Learning Stage
Tip Earnings: $52.5
Service Weeks: 7
Mentoring Required: Yes
Variant 6: Academic Progress Tracker
Problem Statement: Create an academic progress tracking system that monitors student study patterns and predicts success. Your program should:
- Define a function
calculate_study_points(subject_type, hours_studied, difficulty_level)that:- For “mathematics”: earns 12 points/hour at low difficulty, 18 at medium, 25 at high
- For “sciences”: earns 10 points/hour at low difficulty, 15 at medium, 20 at high
- For “languages”: earns 8 points/hour at low difficulty, 12 at medium, 16 at high
- Return the total study points
- Define a function
calculate_mastery_index(semester_count, baseline_score, current_score)that:- Calculate expected score: 1000 + (semester_count * 100)
- Calculate score range: expected_score - baseline_score
- Calculate mastery percentage: (current_score - baseline_score) / score_range * 100
- Return the mastery percentage
- Define a function
determine_progress_tier(mastery_percent)that:- Below 50%: “Foundation Tier”
- 50-60%: “Development Tier”
- 60-70%: “Proficiency Tier”
- 70-85%: “Excellence Tier”
- Above 85%: “Mastery Tier”
- Define a function
calculate_achievement_score(points, hours, tier_modifier)that:- Base score = points * 0.05 + hours * 2
- Tier modifiers: Foundation=0.5, Development=1.0, Proficiency=1.2, Excellence=1.5, Mastery=1.8
- Return the final score rounded to 1 decimal place
- Define a function
needs_tutoring(study_weeks, total_hours, avg_mastery)that:- Returns True if study_weeks >= 6 AND avg_mastery < 50
- Returns True if total_hours < 100 AND avg_mastery < 60
- Returns True if study_weeks >= 4 AND avg_mastery < 40
- Otherwise returns False
- Define a function
generate_progress_report(student, subject_type, hours, difficulty_level, semester_count, baseline_score, current_score, study_weeks)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these student records:
- Record 1: “Parker”, “mathematics”, 45 hours, “high”, semesters=3, baseline_score=800, current_score=1150, study_weeks=3
- Record 2: “Riley”, “sciences”, 60 hours, “medium”, semesters=5, baseline_score=900, current_score=1300, study_weeks=5
- Record 3: “Cameron”, “languages”, 30 hours, “low”, semesters=8, baseline_score=850, current_score=950, study_weeks=7
Expected Output
ACADEMIC PROGRESS TRACKER
========================================
Progress Report for: Parker
----------------------------------------
Subject Type: mathematics
Hours Studied: 45
Difficulty Level: high
Study Points: 1125
Mastery Analysis:
Semesters: 3, Baseline: 800, Current Score: 1150
Mastery: 70.0%
Progress Tier: Excellence Tier
Achievement Score: 219.4
Study Weeks: 3
Tutoring Needed: No
========================================
Progress Report for: Riley
----------------------------------------
Subject Type: sciences
Hours Studied: 60
Difficulty Level: medium
Study Points: 900
Mastery Analysis:
Semesters: 5, Baseline: 900, Current Score: 1300
Mastery: 66.7%
Progress Tier: Proficiency Tier
Achievement Score: 198.0
Study Weeks: 5
Tutoring Needed: No
========================================
Progress Report for: Cameron
----------------------------------------
Subject Type: languages
Hours Studied: 30
Difficulty Level: low
Study Points: 240
Mastery Analysis:
Semesters: 8, Baseline: 850, Current Score: 950
Mastery: 10.5%
Progress Tier: Foundation Tier
Achievement Score: 36.0
Study Weeks: 7
Tutoring Needed: Yes
Variant 7: Movie Theater Management System
Problem Statement: Create a movie theater management system that tracks ticket sales and calculates profits. Your program should:
- Define a function
calculate_ticket_revenue(show_type, tickets_sold, time_slot)that:- For “blockbuster”: generates $12/ticket at morning slot, $18 at afternoon, $25 at evening
- For “standard”: generates $8/ticket at morning slot, $12 at afternoon, $16 at evening
- For “classic”: generates $5/ticket at morning slot, $8 at afternoon, $10 at evening
- Return the total ticket revenue
- Define a function
calculate_occupancy_rate(theater_years, baseline_seats, filled_seats)that:- Calculate expected capacity: 1000 + (theater_years * 100)
- Calculate seat availability: expected_capacity - baseline_seats
- Calculate occupancy percentage: (filled_seats - baseline_seats) / seat_availability * 100
- Return the occupancy percentage
- Define a function
determine_popularity_status(occupancy_percent)that:- Below 50%: “Low Demand”
- 50-60%: “Moderate Demand”
- 60-70%: “Good Demand”
- 70-85%: “High Demand”
- Above 85%: “Sold Out Status”
- Define a function
calculate_total_profit(revenue, tickets, status_multiplier)that:- Base profit = revenue * 0.05 + tickets * 2
- Status multipliers: Low=0.5, Moderate=1.0, Good=1.2, High=1.5, Sold Out=1.8
- Return the final profit rounded to 1 decimal place
- Define a function
needs_promotion(screening_days, total_tickets, avg_occupancy)that:- Returns True if screening_days >= 6 AND avg_occupancy < 50
- Returns True if total_tickets < 100 AND avg_occupancy < 60
- Returns True if screening_days >= 4 AND avg_occupancy < 40
- Otherwise returns False
- Define a function
generate_theater_report(movie_title, show_type, tickets, time_slot, theater_years, baseline_seats, filled_seats, screening_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these movie screenings:
- Screening 1: “Space Adventure”, “blockbuster”, 45 tickets, “evening”, theater_years=3, baseline_seats=800, filled_seats=1150, screening_days=3
- Screening 2: “Comedy Night”, “standard”, 60 tickets, “afternoon”, theater_years=5, baseline_seats=900, filled_seats=1300, screening_days=5
- Screening 3: “Old Classic”, “classic”, 30 tickets, “morning”, theater_years=8, baseline_seats=850, filled_seats=950, screening_days=7
Expected Output
MOVIE THEATER MANAGEMENT SYSTEM
========================================
Theater Report for: Space Adventure
----------------------------------------
Show Type: blockbuster
Tickets Sold: 45
Time Slot: evening
Ticket Revenue: $1125
Occupancy Analysis:
Experience: 3 years, Baseline: 800, Filled Seats: 1150
Occupancy: 70.0%
Popularity Status: High Demand
Total Profit: $219.4
Screening Days: 3
Promotion Needed: No
========================================
Theater Report for: Comedy Night
----------------------------------------
Show Type: standard
Tickets Sold: 60
Time Slot: afternoon
Ticket Revenue: $720
Occupancy Analysis:
Experience: 5 years, Baseline: 900, Filled Seats: 1300
Occupancy: 66.7%
Popularity Status: Good Demand
Total Profit: $187.2
Screening Days: 5
Promotion Needed: No
========================================
Theater Report for: Old Classic
----------------------------------------
Show Type: classic
Tickets Sold: 30
Time Slot: morning
Ticket Revenue: $150
Occupancy Analysis:
Experience: 8 years, Baseline: 850, Filled Seats: 950
Occupancy: 10.5%
Popularity Status: Low Demand
Total Profit: $33.8
Screening Days: 7
Promotion Needed: Yes
Variant 8: Hotel Booking Analytics
Problem Statement: Create a hotel booking analytics system that processes reservation data and calculates occupancy metrics. Your program should:
- Define a function
calculate_room_revenue(room_type, nights_booked, season)that:- For “suite”: generates $150/night at low season, $225 at regular, $350 at peak
- For “deluxe”: generates $100/night at low season, $160 at regular, $240 at peak
- For “standard”: generates $60/night at low season, $95 at regular, $140 at peak
- Return the total room revenue
- Define a function
calculate_booking_rate(hotel_years, baseline_rooms, booked_rooms)that:- Calculate expected bookings: 1000 + (hotel_years * 100)
- Calculate room capacity: expected_bookings - baseline_rooms
- Calculate booking percentage: (booked_rooms - baseline_rooms) / room_capacity * 100
- Return the booking percentage
- Define a function
determine_occupancy_level(booking_percent)that:- Below 50%: “Under Capacity”
- 50-60%: “Fair Occupancy”
- 60-70%: “Good Occupancy”
- 70-85%: “Excellent Occupancy”
- Above 85%: “Full Capacity”
- Define a function
calculate_net_income(revenue, nights, level_factor)that:- Base income = revenue * 0.05 + nights * 2
- Level factors: Under=0.5, Fair=1.0, Good=1.2, Excellent=1.5, Full=1.8
- Return the final income rounded to 1 decimal place
- Define a function
needs_discount_offer(operating_days, total_nights, avg_booking)that:- Returns True if operating_days >= 6 AND avg_booking < 50
- Returns True if total_nights < 100 AND avg_booking < 60
- Returns True if operating_days >= 4 AND avg_booking < 40
- Otherwise returns False
- Define a function
generate_booking_analysis(guest_name, room_type, nights, season, hotel_years, baseline_rooms, booked_rooms, operating_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted analysis (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these hotel bookings:
- Booking 1: “Harrison”, “suite”, 45 nights, “peak”, hotel_years=3, baseline_rooms=800, booked_rooms=1150, operating_days=3
- Booking 2: “Madison”, “deluxe”, 60 nights, “regular”, hotel_years=5, baseline_rooms=900, booked_rooms=1300, operating_days=5
- Booking 3: “Logan”, “standard”, 30 nights, “low”, hotel_years=8, baseline_rooms=850, booked_rooms=950, operating_days=7
Expected Output
HOTEL BOOKING ANALYTICS
========================================
Booking Analysis for: Harrison
----------------------------------------
Room Type: suite
Nights Booked: 45
Season: peak
Room Revenue: $15750
Booking Analysis:
Experience: 3 years, Baseline: 800, Booked Rooms: 1150
Booking Rate: 70.0%
Occupancy Level: Excellent Occupancy
Net Income: $1316.2
Operating Days: 3
Discount Offer Needed: No
========================================
Booking Analysis for: Madison
----------------------------------------
Room Type: deluxe
Nights Booked: 60
Season: regular
Room Revenue: $9600
Booking Analysis:
Experience: 5 years, Baseline: 900, Booked Rooms: 1300
Booking Rate: 66.7%
Occupancy Level: Good Occupancy
Net Income: $720.0
Operating Days: 5
Discount Offer Needed: No
========================================
Booking Analysis for: Logan
----------------------------------------
Room Type: standard
Nights Booked: 30
Season: low
Room Revenue: $1800
Booking Analysis:
Experience: 8 years, Baseline: 850, Booked Rooms: 950
Booking Rate: 10.5%
Occupancy Level: Under Capacity
Net Income: $75.0
Operating Days: 7
Discount Offer Needed: No
Variant 9: Gaming Achievement Tracker
Problem Statement: Create a gaming achievement tracking system that monitors player progress and calculates rewards. Your program should:
- Define a function
calculate_experience_points(game_mode, missions_completed, difficulty)that:- For “campaign”: earns 50 XP/mission at easy difficulty, 85 at normal, 150 at hard
- For “multiplayer”: earns 30 XP/mission at easy difficulty, 55 at normal, 95 at hard
- For “tutorial”: earns 15 XP/mission at easy difficulty, 25 at normal, 40 at hard
- Return the total experience points
- Define a function
calculate_skill_rating(play_hours, baseline_score, current_score)that:- Calculate expected score: 1000 + (play_hours * 100)
- Calculate score range: expected_score - baseline_score
- Calculate skill percentage: (current_score - baseline_score) / score_range * 100
- Return the skill percentage
- Define a function
determine_player_rank(skill_percent)that:- Below 50%: “Bronze Rank”
- 50-60%: “Silver Rank”
- 60-70%: “Gold Rank”
- 70-85%: “Platinum Rank”
- Above 85%: “Diamond Rank”
- Define a function
calculate_reward_coins(xp_points, missions, rank_bonus)that:- Base coins = xp_points * 0.05 + missions * 2
- Rank bonuses: Bronze=0.5, Silver=1.0, Gold=1.2, Platinum=1.5, Diamond=1.8
- Return the final coins rounded to 1 decimal place
- Define a function
needs_practice_mode(gaming_days, total_missions, avg_skill)that:- Returns True if gaming_days >= 6 AND avg_skill < 50
- Returns True if total_missions < 100 AND avg_skill < 60
- Returns True if gaming_days >= 4 AND avg_skill < 40
- Otherwise returns False
- Define a function
generate_achievement_summary(player_name, game_mode, missions, difficulty, play_hours, baseline_score, current_score, gaming_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted summary (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these gaming sessions:
- Session 1: “Phoenix”, “campaign”, 45 missions, “hard”, play_hours=3, baseline_score=800, current_score=1150, gaming_days=3
- Session 2: “Storm”, “multiplayer”, 60 missions, “normal”, play_hours=5, baseline_score=900, current_score=1300, gaming_days=5
- Session 3: “Echo”, “tutorial”, 30 missions, “easy”, play_hours=8, baseline_score=850, current_score=950, gaming_days=7
Expected Output
GAMING ACHIEVEMENT TRACKER
========================================
Achievement Summary for: Phoenix
----------------------------------------
Game Mode: campaign
Missions Completed: 45
Difficulty: hard
Experience Points: 6750
Skill Analysis:
Play Hours: 3, Baseline: 800, Current Score: 1150
Skill Rating: 70.0%
Player Rank: Platinum Rank
Reward Coins: 641.2
Gaming Days: 3
Practice Mode Needed: No
========================================
Achievement Summary for: Storm
----------------------------------------
Game Mode: multiplayer
Missions Completed: 60
Difficulty: normal
Experience Points: 3300
Skill Analysis:
Play Hours: 5, Baseline: 900, Current Score: 1300
Skill Rating: 66.7%
Player Rank: Gold Rank
Reward Coins: 342.0
Gaming Days: 5
Practice Mode Needed: No
========================================
Achievement Summary for: Echo
----------------------------------------
Game Mode: tutorial
Missions Completed: 30
Difficulty: easy
Experience Points: 450
Skill Analysis:
Play Hours: 8, Baseline: 850, Current Score: 950
Skill Rating: 10.5%
Player Rank: Bronze Rank
Reward Coins: 41.2
Gaming Days: 7
Practice Mode Needed: Yes
Variant 10: Library Circulation System
Problem Statement: Create a library circulation system that tracks book borrowing patterns and calculates late fees. Your program should:
- Define a function
calculate_borrowing_volume(material_type, items_borrowed, membership_tier)that:- For “books”: processes 3 items/day at basic tier, 5 at standard, 8 at premium
- For “media”: processes 2 items/day at basic tier, 4 at standard, 6 at premium
- For “journals”: processes 1 items/day at basic tier, 2 at standard, 3 at premium
- Return the total borrowing volume (items_borrowed * rate)
- Define a function
calculate_usage_frequency(library_years, baseline_checkouts, actual_checkouts)that:- Calculate expected checkouts: 1000 + (library_years * 100)
- Calculate checkout capacity: expected_checkouts - baseline_checkouts
- Calculate frequency percentage: (actual_checkouts - baseline_checkouts) / checkout_capacity * 100
- Return the frequency percentage
- Define a function
determine_patron_category(frequency_percent)that:- Below 50%: “Occasional User”
- 50-60%: “Regular User”
- 60-70%: “Frequent User”
- 70-85%: “Power User”
- Above 85%: “Super User”
- Define a function
calculate_late_fees(volume, items, category_reduction)that:- Base fees = volume * 0.05 + items * 2
- Category reductions: Occasional=0.5, Regular=1.0, Frequent=1.2, Power=1.5, Super=1.8
- Return the final fees rounded to 1 decimal place
- Define a function
needs_renewal_reminder(borrowing_weeks, total_items, avg_frequency)that:- Returns True if borrowing_weeks >= 6 AND avg_frequency < 50
- Returns True if total_items < 100 AND avg_frequency < 60
- Returns True if borrowing_weeks >= 4 AND avg_frequency < 40
- Otherwise returns False
- Define a function
generate_circulation_report(patron_name, material_type, items, membership_tier, library_years, baseline_checkouts, actual_checkouts, borrowing_weeks)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these library records:
- Record 1: “Ashton”, “books”, 45 items, “premium”, library_years=3, baseline_checkouts=800, actual_checkouts=1150, borrowing_weeks=3
- Record 2: “Bailey”, “media”, 60 items, “standard”, library_years=5, baseline_checkouts=900, actual_checkouts=1300, borrowing_weeks=5
- Record 3: “Casey”, “journals”, 30 items, “basic”, library_years=8, baseline_checkouts=850, actual_checkouts=950, borrowing_weeks=7
Expected Output
LIBRARY CIRCULATION SYSTEM
========================================
Circulation Report for: Ashton
----------------------------------------
Material Type: books
Items Borrowed: 45
Membership Tier: premium
Borrowing Volume: 360
Usage Analysis:
Experience: 3 years, Baseline: 800, Actual Checkouts: 1150
Frequency: 70.0%
Patron Category: Power User
Late Fees: $162.0
Borrowing Weeks: 3
Renewal Reminder Needed: No
========================================
Circulation Report for: Bailey
----------------------------------------
Material Type: media
Items Borrowed: 60
Membership Tier: standard
Borrowing Volume: 240
Usage Analysis:
Experience: 5 years, Baseline: 900, Actual Checkouts: 1300
Frequency: 66.7%
Patron Category: Frequent User
Late Fees: $158.4
Borrowing Weeks: 5
Renewal Reminder Needed: No
========================================
Circulation Report for: Casey
----------------------------------------
Material Type: journals
Items Borrowed: 30
Membership Tier: basic
Borrowing Volume: 30
Usage Analysis:
Experience: 8 years, Baseline: 850, Actual Checkouts: 950
Frequency: 10.5%
Patron Category: Occasional User
Late Fees: $30.8
Borrowing Weeks: 7
Renewal Reminder Needed: Yes
Variant 11: Food Delivery Performance Tracker
Problem Statement: Create a food delivery performance tracking system that monitors delivery metrics and calculates driver earnings. Your program should:
- Define a function
calculate_delivery_revenue(order_type, deliveries_completed, time_period)that:- For “express”: earns $8/delivery at morning period, $12 at lunch, $18 at dinner
- For “regular”: earns $5/delivery at morning period, $8 at lunch, $12 at dinner
- For “bulk”: earns $15/delivery at morning period, $22 at lunch, $30 at dinner
- Return the total delivery revenue
- Define a function
calculate_completion_rate(driver_months, baseline_orders, completed_orders)that:- Calculate expected orders: 1000 + (driver_months * 100)
- Calculate order capacity: expected_orders - baseline_orders
- Calculate completion percentage: (completed_orders - baseline_orders) / order_capacity * 100
- Return the completion percentage
- Define a function
determine_driver_tier(completion_percent)that:- Below 50%: “Starter Tier”
- 50-60%: “Bronze Tier”
- 60-70%: “Silver Tier”
- 70-85%: “Gold Tier”
- Above 85%: “Elite Tier”
- Define a function
calculate_total_earnings(revenue, deliveries, tier_bonus)that:- Base earnings = revenue * 0.05 + deliveries * 2
- Tier bonuses: Starter=0.5, Bronze=1.0, Silver=1.2, Gold=1.5, Elite=1.8
- Return the final earnings rounded to 1 decimal place
- Define a function
needs_route_optimization(delivery_days, total_deliveries, avg_completion)that:- Returns True if delivery_days >= 6 AND avg_completion < 50
- Returns True if total_deliveries < 100 AND avg_completion < 60
- Returns True if delivery_days >= 4 AND avg_completion < 40
- Otherwise returns False
- Define a function
generate_delivery_summary(driver_name, order_type, deliveries, time_period, driver_months, baseline_orders, completed_orders, delivery_days)that:- Calls all necessary functions to calculate metrics
- Prints a formatted summary (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these delivery records:
- Record 1: “Drew”, “bulk”, 45 deliveries, “dinner”, driver_months=3, baseline_orders=800, completed_orders=1150, delivery_days=3
- Record 2: “Ellis”, “regular”, 60 deliveries, “lunch”, driver_months=5, baseline_orders=900, completed_orders=1300, delivery_days=5
- Record 3: “Frankie”, “express”, 30 deliveries, “morning”, driver_months=8, baseline_orders=850, completed_orders=950, delivery_days=7
Expected Output
FOOD DELIVERY PERFORMANCE TRACKER
========================================
Delivery Summary for: Drew
----------------------------------------
Order Type: bulk
Deliveries Completed: 45
Time Period: dinner
Delivery Revenue: $1350
Completion Analysis:
Experience: 3 months, Baseline: 800, Completed Orders: 1150
Completion Rate: 70.0%
Driver Tier: Gold Tier
Total Earnings: $236.2
Delivery Days: 3
Route Optimization Needed: No
========================================
Delivery Summary for: Ellis
----------------------------------------
Order Type: regular
Deliveries Completed: 60
Time Period: lunch
Delivery Revenue: $480
Completion Analysis:
Experience: 5 months, Baseline: 900, Completed Orders: 1300
Completion Rate: 66.7%
Driver Tier: Silver Tier
Total Earnings: $172.8
Delivery Days: 5
Route Optimization Needed: No
========================================
Delivery Summary for: Frankie
----------------------------------------
Order Type: express
Deliveries Completed: 30
Time Period: morning
Delivery Revenue: $240
Completion Analysis:
Experience: 8 months, Baseline: 850, Completed Orders: 950
Completion Rate: 10.5%
Driver Tier: Starter Tier
Total Earnings: $36.0
Delivery Days: 7
Route Optimization Needed: Yes
Variant 12: Customer Service Quality Monitor
Problem Statement: Create a customer service quality monitoring system that evaluates agent performance and calculates bonuses. Your program should:
- Define a function
calculate_tickets_value(ticket_type, tickets_resolved, priority_level)that:- For “technical”: values at $20/ticket for low priority, $35 for medium, $55 for high
- For “billing”: values at $15/ticket for low priority, $25 for medium, $40 for high
- For “general”: values at $10/ticket for low priority, $18 for medium, $28 for high
- Return the total tickets value
- Define a function
calculate_resolution_efficiency(agent_quarters, baseline_tickets, resolved_tickets)that:- Calculate expected tickets: 1000 + (agent_quarters * 100)
- Calculate ticket capacity: expected_tickets - baseline_tickets
- Calculate efficiency percentage: (resolved_tickets - baseline_tickets) / ticket_capacity * 100
- Return the efficiency percentage
- Define a function
determine_performance_level(efficiency_percent)that:- Below 50%: “Developing Level”
- 50-60%: “Competent Level”
- 60-70%: “Proficient Level”
- 70-85%: “Advanced Level”
- Above 85%: “Expert Level”
- Define a function
calculate_performance_bonus(value, tickets, level_multiplier)that:- Base bonus = value * 0.05 + tickets * 2
- Level multipliers: Developing=0.5, Competent=1.0, Proficient=1.2, Advanced=1.5, Expert=1.8
- Return the final bonus rounded to 1 decimal place
- Define a function
needs_additional_training(service_weeks, total_tickets, avg_efficiency)that:- Returns True if service_weeks >= 6 AND avg_efficiency < 50
- Returns True if total_tickets < 100 AND avg_efficiency < 60
- Returns True if service_weeks >= 4 AND avg_efficiency < 40
- Otherwise returns False
- Define a function
generate_quality_report(agent_name, ticket_type, tickets, priority_level, agent_quarters, baseline_tickets, resolved_tickets, service_weeks)that:- Calls all necessary functions to calculate metrics
- Prints a formatted report (no return value)
- Include all calculated values and recommendations
Testing Inputs: Test your system with these service records:
- Record 1: “Harper”, “technical”, 45 tickets, “high”, agent_quarters=3, baseline_tickets=800, resolved_tickets=1150, service_weeks=3
- Record 2: “Indigo”, “billing”, 60 tickets, “medium”, agent_quarters=5, baseline_tickets=900, resolved_tickets=1300, service_weeks=5
- Record 3: “Jesse”, “general”, 30 tickets, “low”, agent_quarters=8, baseline_tickets=850, resolved_tickets=950, service_weeks=7
Expected Output
CUSTOMER SERVICE QUALITY MONITOR
========================================
Quality Report for: Harper
----------------------------------------
Ticket Type: technical
Tickets Resolved: 45
Priority Level: high
Tickets Value: $2475
Efficiency Analysis:
Experience: 3 quarters, Baseline: 800, Resolved Tickets: 1150
Efficiency: 70.0%
Performance Level: Advanced Level
Performance Bonus: $320.6
Service Weeks: 3
Additional Training Needed: No
========================================
Quality Report for: Indigo
----------------------------------------
Ticket Type: billing
Tickets Resolved: 60
Priority Level: medium
Tickets Value: $1500
Efficiency Analysis:
Experience: 5 quarters, Baseline: 900, Resolved Tickets: 1300
Efficiency: 66.7%
Performance Level: Proficient Level
Performance Bonus: $234.0
Service Weeks: 5
Additional Training Needed: No
========================================
Quality Report for: Jesse
----------------------------------------
Ticket Type: general
Tickets Resolved: 30
Priority Level: low
Tickets Value: $300
Efficiency Analysis:
Experience: 8 quarters, Baseline: 850, Resolved Tickets: 950
Efficiency: 10.5%
Performance Level: Developing Level
Performance Bonus: $37.5
Service Weeks: 7
Additional Training Needed: Yes
This content will be available starting October 22, 2025.