Due Friday, October 29 by the beginning of class
You may make any other changes necessary to achieve these three goals. Name the code file "dblftoc.cpp".
In order to print out double values, you will need to change the printf statement to this:
printf ("%3.0f\t%6.1f\n", fahrenheit, celsius);
If you are using Visual C++, you may use this VC++ project, which is already set up with an empty file for your code, named dblftoc.cpp.
DoubleFtoC.zip
/*
* This program prints a list of
* integers, from 0 to 9.
*/
#include <stdio.h>
int main (void)
{
int i;
for (i = 0; i < 10; i = i + 1)
printf (“i is %d\n”, i);
return 0;
}
Type this program in and run it, to make sure it compiles without errors or warnings, and that it works correctly. Once you have done that, change the statement:
for (i = 0; i < 10; i = i + 1)to use either of the increment operators (preincrement or postincrement) or the += operator (you can choose which you'd like to use).
You may use this Visual C++ project for this question; it has been set up for you with a file named list.cpp.
List.zip
What I want you to turn in, and how:
The files I want to receive from you are dblftoc.cpp and list.cpp.
Turnin options are:
- As before, you may leave the files in a folder named Homework\HW2 in your cs5a account's home directory. This is the preferred method of turning in your homework.
- You may also email the two files (in a single e-mail message, please!) to cs5a@ieng9.ucsd.edu
- If you can't do either of those, you may bring me a PC-format floppy disk in class.