This project was designed by Leigh Anne Fitz of Virginia Beach City Public Schools and the autograding tests were designed by Kate McDonnell of Cherry Creek Schools in Colorado.
Your school is running a Seven-Day Fitness Challenge. Students will enter the number of minutes they exercised each day for one week. The program will analyze their activity and determine whether they met their daily goals. Create a Python program that helps a student track their exercise for one week.
Input Validation: Exercise minutes must be between 0 and 300. If the user enters an invalid value, the program should continue asking until a valid value is entered. For example:
How many minutes did you exercise? -20
Please enter a value between 0 and 300.
How many minutes did you exercise? 400
Please enter a value between 0 and 300.
How many minutes did you exercise? 35
Activity Level: Good
Overall Weekly Assessment: At the end of the week, determine an overall assessment based on the studentβs average daily exercise time.
========================================
SEVEN-DAY FITNESS CHALLENGE
========================================
Day 1: 30 minutes
Activity Level: Good
Day 2: 45 minutes
Activity Level: Great
Day 3: 15 minutes
Activity Level: Needs Improvement
Day 4: 60 minutes
Activity Level: Excellent
Day 5: 40 minutes
Activity Level: Great
Day 6: 25 minutes
Activity Level: Good
Day 7: 50 minutes
Activity Level: Great
========================================
WEEKLY SUMMARY
========================================
Total Exercise Minutes: 265
Average Daily Minutes: 37.86
Overall Assessment: Good Job!
========================================
Project2.15.1Seven-Day Fitness Challenge.
Create a Python program that helps a student track their exercise for one week. The program should use a loop to ask for the number of exercise minutes for each of 7 days, validate each entry, determine the activity level for each day, keep track of the total exercise minutes, calculate the average daily exercise time, and provide an overall assessment.
Consider the first iteration statement in your project code above (the for loop). Identify the loop variable by writing it below. Identify the number of times the body of your iteration statement will execute. Explain how a for loop using range cannot cause an infinite loop.
Activity2.15.3Project Reflection: Loops and Input Validation.
Describe how you used a while loop to validate input. What happened when the user entered an invalid value? How did you test your program to make sure that invalid values were rejected and valid values were accepted? Describe a condition or error that would cause your iteration statement to not terminate and cause an infinite loop.