Note: Edited Friday August 24, at 2:10pm Don't let the last problem confuse you too much - just think, you have the 3 digits coming into your funtion as parameters. Which one represents the ones digit? Which the tens digit? Which the 100s digit? Use multiplication and addition to actually calculate the correct integer you can build from knowing the values of the individual digits. (The books hint makes it all sound way too strange...) Note: Edited Friday August 24, at 3am. No problems have changed. Don't use the GUI mentioned in problem 1. Otherwise all is fine. Do all 3 problems. ------------------Nothing changed below this line----------------------- CS1321 Fall 2002 Homework 2 Due Tuesday, August 28, 2001 The following problems are programming problems to be done using DrScheme. Be sure to save your function definitions by selecting "Save Definitions"/"Save Definitons as from the "File" menu of DrScheme. You will turn in this assignment during class on Tuesday, August 28, 2001, so bring a printout of your functions to class. (Actually make two printouts: one to keep during class, and one to turn in at the beginning of class.) NOTE FOR YOUR CODING: In addition to the contract outline specified in p. 17, we will add and name, gtnumber and class/assignment field. Thus: ;; John Doe ;; gt1234a ;; cs1321 homework ;; Contract: area-of-ring: number number --> number ;; Purpose : to etc. etc. etc. 1. Define a function called Celsius->Fahrenheit, a function that takes a temperature in Celsius as a paramter and produces the equivalent temperature in Fahrenheit. You might remember that the formula to convert a Fahrenheit temperature to it's Celsius equivalent is C = (5/9) (F - 32) Note: Hardback Book: Page 10 http://www.htdp.org/2001-01-18/Book/node18.htm Online: http://www.htdp.org/2001-01-18/Book/node18.htm shows you how to combine your function with a supplied gui and interaction system. Try using the GUI to drive your function once you have run it directly. 2. For the past few weeks you've been plodding your way through the famous Science-Fiction trilogy Red Mars, Green Mars, Blue Mars (by Kim Stanley Robinson). Every measurement concerning the outside temperature is measured not in Celsius or Fahrenheit, but in units Kelvin. You think it would be fun to write a function Fahrenheit->Kelvin that allows you to take your familiar temperature in Fahrenheit and convert it to a temperature in Kelvin. Write the function, Fahrenheit->Kelvin. This function takes in a single temperature measure in degrees Fahrenheit. NOTE: A measurement in Kelvin is 273 degrees higher than the equivalent measurement in Celsius. 3. problem 2.2.4 from the book "Variables and Programs" section Hardcopy: page 11 Online: http://www.htdp.org/2001-01-18/Book/node11.htm