extra-labs - Old Labs I'm providing this page with some old...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Old Labs I'm providing this page with some old labs I've used in related courses for those who want extra practice. The programming content for these labs is up to and including switch on the 201 schedule. Some ("Even/Odd") are very short; others ("Movie Time") take quite a bit of time. Enjoy! Movie Time! Using integer division and the mod operator, write a program that tells what time a movie will end, given the movie's advertised start time and the movie's duration (in minutes). Guidelines/assumptions: Assume the movie starts right at the advertised time. Ignore any commercials/previews that may be played by the theater. You may ignore the issue of AM vs. PM. However, it is possible for a movie to start before midnight and end after midnight. Your program should print times like "1:30" rather than "13:30." You may use the hour "0" for the "12:00" hour. That is, "0:30" is an acceptable way to display "12:30." Hint: Follow the IPO model. Specifially, create output varaibles for the movie's end time and compute these before you try doing any output. You'll likely need some variables for processing too. Here is a example of how you should interact with the user (user's inputs typed at the command line are in orange ): Enter the time the movie starts. You'll first enter the hour, then the minutes past this hour. Which hour? 10 How many minutes past 10:00? 45 How many minutes long is the movie? 150 So. .. this movie starts at 10:45 and ends at 1:15. Compound Interest
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 02/10/2011.

Page1 / 4

extra-labs - Old Labs I'm providing this page with some old...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online