## CS 1713 Section 3, Spring 1997 Assignment 2: Simple Computations with User Input

For this assignment, you will:

• Make a subdirectory called assign2 in your account. Do your work for this assignment in this directory. The process of creating a subdirectory and using it was covered in the CS 1711 section the second week of school; if you need to refresh your memory, see the blue Unix System V book.
• Write a C program called c2f.c that
• Prompts the user with "Enter degrees Fahrenheit:"
• Reads a floating point number using scanf
• Converts the number from degrees Fahrenheit to Celcius and Kelvin
• Prints the original number, then " degrees Fahrenheit is ", then the Celcius temperature, then " Celcius and ", then the Kelvin temperature, then " Kelvins."
For instance, if the user enters 212, your program should print:

212.0 degrees Fahrenheit is 100.0 Celcius and 373.0 Kelvins

Make sure to put descriptive comments and your name in your program; see the program in Assignment 1 for a model of how to use comments.
• Use a makefile to compile your program. Make files will be covered in the January 28/30 CS 1711 sections. Basically, you will create a file called Makefile in your assign2 directory that looks like this:
```CC	=	cc
CFLAGS	=	-g

all: 		c2f
\$(CC) -o c2f c2f.o

c2f:		c2f.o

c2f.o:		c2f.c
```
When you type make in this directory, your program will be automatically compiled using the instructions in the Makefile, which say to use the cc compiler with the -g option (for debugging), and call the resulting executable c2f. (It may seem a little silly to go through all this when one could simply invoke cc from the command line, but once we start compiling programs with many different C files, cc by itself becomes very cumbersome.)
• Run the program on several test cases until you are confident the program works.
• Send the instructor the C program file (the file you made with vi, not the binary executable) with the command:

Mail -s "CS1713 Assignment 2" djimenez@ringer.cs.utsa.edu < c2f.c

• In your weekly progress report due Monday night, report on your experiences writing the program. Give examples of the output of your program.

This assignment is due at midnight on Monday, February 3, 1997.