CS60 Homework Assignment 2 -------------------------- Due: Wed, Oct 1st Write a program that asks the user three questions: their first and last initial (in one question/one call to scanf), the year they were born, and their current body temperature in fahrenheit. The initials are single characters, the birthyear is an integer, but the bodytemp should be inputted as a floating point value. After all of this data gathering, the program should print out the following message: Well, .
  • ., it seems as though you are now age . And in case you were wondering, your body temp, in celsius, is . The output should be followed by a newline. ex: To grade, we will input the initials 'D' for first and 'N' for last, birth year '1978' and current body temp of '98.5'. A run of the program should look like the following: [nurmi@localhost hw2]$ gcc hw2.c [nurmi@localhost hw2]$ ./a.out Please enter your first and last initials: DN Please enter your birth year: 1978 Please enter your current body temp (in fahrenheit): 98.5 Well, D.N., it seems as though you are now age 25. And in case you were wondering, your body temp, in celsius, is 36.944443. [nurmi@localhost hw2]$ You must turn in the code and a typescript showing compilation and execution of your program on a CSIL machine. The turnin tage for this assignment is 'hw2' ( % turnin hw2@cs60 ). Extra Credit ------------ One point of extra credit will be awarded if you add error checking to your program for each of the three questions. The user of the program should only be able to input capital letters for their initials, positive integers less than the current year for the birthdate, and a positive number for the current body temperature. You may use the functions 'isalpha', 'isupper' and standard 'if' control structures to perform these checks. If an incorrect input is given, the program may ask again or it may simply exit at that point. Extra credit will only be awarded if error checking is implimented for all three questions and is shown in the turned in typescript!