CS201
Lab 3 - Simple C Functions
Objective
- Solve a problem using C Functions.
Reading
- Read Chapter 3 in the Hanly/Koffman text. Also read related lecture notes.
Deliverables (DUE BY THE END OF THE 4th LAB!)
- Submittal of your lab3.c and Makefile files.
TO DO (for today's lab)
- Design and Write a program to solve Programming Project #10
on page 143 of the Hanly/Koffman text.
- As input depth in kilometers, use positive number with
a fractional part. Prompt for these values and read them using
scanf.
- A sample run of your program assuming "lab3" for the name of your
executable would look like the following:
$ lab3
Enter depth (in kilometers)> 10.00
The celcius temperature is 120.00 degree celcius.
The farenheit temperature is 248.00 degree farenheit.
- Your program should contain the following two functions
1) celcius_at_depth that takes depth as input parameter and returns celcius temperature as output parameter.
2) farenheit that takes celcius temperature as input parameter and returns farenheit temperature as output parameter.
- Your main function should contain statements that prompt messages and show outputs.
- Be careful about the type of input/output parameters.
- Be careful about formatting of your output.
- Properly document your code and follow all code conventions discussed in the class.
- If you finish your assignment during the lab session, call your TA and get checked off instantly.
Grading Scheme
Program compile and execute as specified 30%
Program meets all specifications 50%
Program follow code conventions and contain proper documentation. 20%
No Enrichment this week