#
# Author    :   Patrice Koehl
# Student ID:   None!
# Date      :   11/19/13
#
#
# Problem 1
#
# Provide small description to user:
#
print "Problem 1: Compute tips"
print "=======================\n"
#
# Read total amount of restaurant's bill
#
bill=raw_input("Enter total amount on bill -> ")
#
# Raw_input gives a string: need to convert it to a float
#
xbill=float(bill)
#
# Compute two options for tip: 15% and 20%
#
tip15 = xbill*0.15
tip20 = xbill*0.20
#
# Print tips:
#
print "\n"
print "You have two options for the tip:"
print "     15%         -> ",tip15
print "     20%         -> ",tip20
print "\n"
#
#
# Problem 2
#
# Provide small description to user:
#
print "Problem 2: play with strings"
print "============================\n"
#
# Read sentence from standard input:
#
sentence=raw_input("Enter your sentence -> ")
#
# Put whole sentence in lower case
#
sentence_lower = sentence.lower()
#
# Set all vowels in uppercase
#
sentence1=sentence_lower.replace("a","A")
sentence2=sentence1.replace("e","E")
sentence3=sentence2.replace("i","I")
sentence4=sentence3.replace("o","O")
sentence5=sentence4.replace("u","U")
sentence_two=sentence5.replace("y","Y")
#
# Get sentence in reverse order
#
sentence_reverse = sentence[::-1]
#
# Now print the different sentences
#
print "\n"
print "Sentence in lower case        : ",sentence_lower
print "Sentence with vowel uppercase : ",sentence_two
print "Sentence reversed             : ",sentence_reverse
print "\n"
#
# Problem 3
#
# Provide small description to user:
#
print "Problem 3: Count words and characters"
print "=====================================\n"
#
# Read sentence from standard input
#
sentence3=raw_input("Enter your sentence -> ")
#
# Get total number of characters (including space)
#
nchartot = len(sentence3)
#
# Get number of white spaces
#
nspace = sentence3.count(" ")
#
# The number of words is the number of white space + 1!
#
nword = nspace + 1
#
# The number of characters (not counting space)
#
nchar = nchartot - nspace
#
# Print results
#
print "\n"
print "The number of words in the sentence is           :",nword
print "The number of characters (not counting space) is :",nchar
print "\n"
