This problem set covers Chapter 3.

Sentence Response (5 points)

(Programming Projects #4, Page 190) Write a program that reads a one-line sentence as input and then displays one of the following responses:

Your program does not have to check the input to see that the user has entered a legitimate sentence.

Temperature Converter (5 points)

(Programming Projects #5, Page 190) Write a program that allows the user to convert a temperature given in degrees from either Celcius to Farenheight or Farenheight to Celcius. Use the following formulas:

Degrees_C = 5 (Degrees_F - 32)/9
Degrees_F = (9/5)Degrees_C + 32

Prompt the user to enter a temperature followed by either 'C' or 'c' for Celcius or a temperature followed by 'F' or 'f' for Farenheight. Convert the temperature to Farenheight if Celcius is entered, or to Celcius if Farenheight is entered. Display the result in a readable format. If anything other than 'C', 'c', 'F', or 'f' is entered, print an error message and stop.

Remove Profanity (5 points)

(Programming Projects #8, Page 191) Suppose we are working for an online service that provides a bulletin board for its users. We would like to give our users the option of filtering out profanity. Suppose we consider the words cat, dog and llama to be profane. Write a program that reads a string from the keyboard and tests whether the string contains one or more of our profane words. Your program should find words like cAt that differ only in case. Your program should display the read string with the profanities replaced with the character '*'.

Extra Credit As an extra challenge, have your program modify lines that contain profanities only, not lines that contain words like, dogmatic or concatenate or category.