Cse 5A Introduction To Programming (C/C++) Homework 2
Cse 5A Introduction To Programming (C/C++) Homework 2
After logging in, create a new folder/directory in your cs5f Home on ieng9 named HW2 (note uppercase HW2).
You can do this via My Computer -> WebDrive drive W: cs5f..@ieng9 – Home Directory and then create a
New -> Folder and name it HW2.
Using Bloodshed Dev-C++, create a new Source File (File -> New -> Source File) with File Type C Source
Files (*.c), File Name: hw2.c (note lowercase hw2.c). Then Save As in the new W: WebDrive/HW2 folder you
created above (File -> Save As). Feel free to ask the tutors on duty in the lab for help.
HW2/hw2.c will be a program to convert degrees Fahrenheit (F) to degrees Celsius (C) and vice versa. All
variables should be of type double. Here are the initial values for some of the variables.
double F_Degree_1 = 98.60;
double F_Degree_2 = 0.00;
double F_Degree_3 = -4.20;
Use the printf() format specifier %.2f to output all of your double floating point variables with 2 places
precision to the right of the decimal point. Comment your program similar to the last program in Notes #1.
1
No hardcoding of the values above in the code. For example, you cannot use the constant value 98.60
anywhere in your program other than in the initialization of a variable (for example, double F_Degree_1 =
98.60;). You must use variables throughout the program and your printf() statements, not constant numbers.
We will automatically collect your HW2/hw2.c files from your cs5f course specific home directories on ieng9
at 6pm on Friday. Make sure your HW2 project is stored in your cs5f home directory folder. If you have any
questions/problems with this, see one of the tutors or the instructor.
Make sure you have your name and cs5f account number in the header comment of hw2.c.
/*
* Name: Jane-Joe Student
* Login: cs5fXX
* Date: Month Day, Year
* File: hw2.c
* Sources of Help:
I will place a sample executable in the Class Resources / cs5f Public directory under Examples folder
hw2.exe