Exam 2- 2012

5 in rohnert park cs 115 exam 2 fall 2012 page 4 of

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: , and “u”) omitted. For example: Enter a line of text: San Francisco Giants sn frncsc gnts (b) Ask the user to enter the price of an item. • If the user does not enter a valid, non ­negative number, print an error message. • Otherwise, compute and print the sales tax on that item (8.5% in Rohnert Park). CS 115 Exam 2, Fall 2012 Page 4 of 7 (c) Ask the user to guess your favorite number. You can assume the user enters valid integers. • If the user correctly guesses your favorite number (use any integer you want), print a congratulatory message and do not prompt them anymore. • If the user guesses a number that is lower than your favorite number, tell them to guess a higher number, and repeat these actions. • If the user guesses a number that is higher than your favorite number, tell them to guess a lower number, and repeat these actions....
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