3-
1. Temp Conversions(Savitch, page 205, problem 2) Write a program that allows the user to convert either from degrees Celsius to Fahrenheit or degrees Fahrenheit to Celsius. Use the following formulas:
degreesC = 5(degreesF - 32)/9
degreesF = (9(degreesC)/5) + 32
Prompt the user to enter a temperature and either a 'C'(or 'c') for Celsius or an 'F'(or 'f') for Fahrenheit: allow either upper or lower case, but if anything other than 'C', 'c', 'F', or 'f' is entered, print an error message and ask the user to reenter a valid selection(upper or lower case 'C' or 'F'). Convert the temperature to Fahrenheit if Celsius is entered or to Celsius if Fahrenheit is entered, then ask the user to enter 'Q' or 'q' to quit or any other key to repeat the loop and perform another conversion.
2. Integer List information(Savitch, page 205, problem 3). Write a program to read in a list of nonnegative integers and output the following: the largest integer, the smallest integer, and the average of all the integers. The end of the input is indicated by the user entering a negative sentinel value. Note that the sentinel value is not used in finding the largest, smallest, or or average value. It is only an end marker. The average should be of type double so that the average is computed with a fractional part.
3. Solid Square. Write a program that read a positive integer value n between 1 and 50 from the user and will then output a solid square of asterisks where each side of the square has n asterisks. You will need to print n asterisks on each line for n lines. Hint:you will want to use some sort of nested loop for this problem. The outer loop will control the row or number of lines you output while the inner loop will control the column or number of asterisks you put in each line. An example of the output of the program might be:
Enter a positive integer between 1 and 50: 6
* * * * * *
* * * * * *
* * * * * *
* * * * * *
* * * * * *
* * * * * *
4. Ask me, A.I. Extra Credit problem(worth 5 quiz points). (Savitch, page 204-5, problem 1). Write a program that takes a one-line sentence as input and then outputs the following response: If the sentence ends with the questions mark '?' and the input contains an even number of characters, then output the word "Yes." If the sentence ends with the question mark '?' and the input contains an odd number of characters, then output the word "No." If the sentence ends with an exclamation mark '!', then output the word "Wow." In all other cases, your program will output the string "You always say " followed by the input string enclosed in quotes. You ouput should all be on one line. Be sure to not that in the last case, you output must include quotation marks around the echoed input string. In all other cases, there are no quotes in the input. You program should have a loop that allows the user to repeat this until the user indicates that she/he wants to end the program. You program does NOT have to check the input to see that the user entered a legitimate sentence.