THIS IS A PRELIMINARY VERSION. THERE MAY BE CHANGES. READ THE WHOLE FILE AND DO SO CAREFULLY. DO NOT TURN THIS IN WITH THE turnin PROGRAM BEFORE 5 AM Saturday, January 18. If you finish before then, just wait a while before turning it in. Also, check for changes before turning it in. CSE 10 UCSD Winter, 1997 Assignment 3 Deadlines: For turnin program: Thursday Jan 23 For interview: Wednesday Jan 29 Reading: Chapters 3 and Section 4.1 of Chapter 4 all in the Savitch text Programming: In this exercise you will start with a partially written program and fill in the missing code. In most cases what is missing are function definitions. The program with the blanks to fill in is in the file hw03.template. You must fill in some missing code in the main part of the program and you must give four function definitions. The completed program will ask the user if he/she wants to convert from miles to kilometers or from kilometers to miles. The user responds with M or m for the first case and with K or k for the second case. If the user responds with any thing else, he/she is asked the question again, and again until an appropriate response is made. The program will then ask for the appropriate input and compute the appropriate answer. The program then repeats this action again and again until the user says to quit. More specifically, after doing one calculation, the program asks: Do you want to do it again? Enter Y for yes or N for no. The user responds with Y, y, N , or n. If the user responds with anything else, the user is asked again and again until the user responds with one of these four letters. To see what the dialogue should be like you can run hw03.o which contains the compiled object code from a solution to this assignment. Details: >Your definition of the function from_miles_or_from_kilometers must use a local variable named ans. >You do not need to define any functions besides those whose prototypes are given in hw03.template. >Be sure to place all function definitions after main and to leave the function prototypes before main. >The function new_line(), whose prototype is given below, takes zero arguments. This function will disregard all the input remaining on a line so that the next time there is a cin, the input will be taken from the next line. The definition of new_line is given in hw03.template. You do not need to understand the definition. You only need to know how to use the function new_line. This function will allow the user to enter "yes" when the program wants only the letter y and the call to new_line will throw away the e and the s. Run hw03.o and try it to see how it works. void new_line(); //Discards all the input remaining on the current input line. >The function from_miles_or_from_kilometers, takes no arguments and returns one of the two letters, uppercase 'M' or uppercase 'K'. This function is unlike any in the text book in that it gets it's information by carrying on a dialogue with the user, rather than having any arguments. Run the sample object code to see what this dialogue should be like. >The function get_yes_or_no is similar to from_miles_or_from_kilometers in that it also gets it's information by carrying on a dialogue with the user, rather than having any arguments. >It is good programming practice to check the user's input. Your program must check any character input to see that the user typed in one of the appropriate letters (such as Y, y, N, or n as an answer to a yes/no question). When the user is asked for a number, you do not have to check the input to see if it is appropriate (because it's still to hard for you to do it). >Your input/output must be identical to that of hw03.o