Exam 1- 2013

You can assume that the user only enters valid

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to Problem 2. (a) Ask the user to enter the number of miles they drove today. You can assume the user enters a numeric value. If the user’s input is negative, print an error message. Otherwise, tell them how many kilometers they drove (1 mi = 1.60934 km). (b) Ask the user to enter 300 integers. You can assume that the user only enters valid integers. After the user has entered all 300 integers, print the sum of all the odd integers entered by the user. CS 115 Exam 1, Spring 2013 Page 5 of 8 (c) Ask the user for the name of the greatest band...
View Full Document

This note was uploaded on 02/08/2014 for the course CS 115 taught by Professor Staff during the Fall '08 term at Sonoma.

Ask a homework question - tutors are online