CS 1713 Section 2, Fall 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. To make
the directory, use the following command on runner:
mkdir assign2
To change to that directory so that you may work in it, instead of
the current (home) directory, do:
cd assign2
When you want to return to your home directory, simply type cd
with no parameters.
- Write a C program called f2c.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.
- 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 < f2c.c
- In your weekly progress report due Wednesday night, report on your
experiences writing the program. Give examples of the output of your
program.
This assignment is due at midnight on Wednesday, September 10, 1997.