Lab 4

Introduction:

In this lab, you will practice using for loops by calculating calories burned on a treadmill. You will also work with adding elements to a list and indexing and slicing that list.

Calories Burned on a Treadmill

Our textbook claims that the average person burns 4.2 calories/minute on a treadmill. Write a program using a for loop and the range function to display the number of calories burned after 10, 15, 20, 25, and 30 minutes.

A Few of Your Favorite Things

This program will ask the user for their favorite things. The program should continue asking for their favorite things until the user is finished asking. Use a sentinel value for the user to use to indicate that they are finished entering their favorite things. In the assignment information sheet, explain your choice of sentinel value.

Once the user is finished entering their favorite things, print out:

Here is an example of the program (user input is bold and underlined):

Please tell me your favorite things! When you're finished, type "I'm finished telling you my favorite things."
Favorite thing: raindrops on roses
Favorite thing: whiskers on kittens
Favorite thing: bright copper kettles
Favorite thing: warm woollen mittens
Favorite thing: brown paper packages tied up with strings
Favorite thing: cream colored ponies
Favorite thing: I'm finished telling you my favorite things.

Thanks! You entered 6 things.
The first was: raindrops on roses
The last was: cream colored ponies
Since you entered an even number of things, the middle two favorite things are:
    bright copper kettles
    warm woollen mittens

The first four items you entered are: ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles', 'warm woollen mittens']

Submission and Grading:

Complete the Assignment Information Sheet.

Submit your final program and assignment information sheet (zipped into one file) to CourseWeb in the Lab 4 assignment.

The grading rubric can be found here: Rubric (doc).

The assignment is due Monday, June 15 by 11:30 am. As with all programming assignments, you have unlimited uploads (before the deadline), so you may upload the assignment before the deadline. If you later decide to upload another, you may do so without penalty (as long as it's before the assignment deadline). The last submission uploaded before the deadline will be the one graded. If you would like ungraded feedback on a programming assignment, you may send an email to your TA or the instructor and ask for feedback; please send your code as well.

For more advice on submitting your assignment, see the Programming Assignments section of the Tips for Success page.