Project Instructions
You will find detailed step-by-step instructions below on downloading and installing the compiler. However, the basic steps of the project are as follows:
- Download and install the MinGW compiler for C++.
- Compile the code file provided (GooddocsF.cpp).
- Test the resulting executable file. [The program is designed to produce temperature conversions.]
- Debug the program by correcting minor errors that have been deliberately placed in the temperature calculation formulas. Note: The formulas coded in the program are incorrect. The formulas in the program documentation at the start of the program are correct.
- Recompile the corrected code and retest the program.
- Submit the uncorrected and corrected versions of the program.
Coding, Compiling, and Debugging
-
Download the C++ code GooddocsF.cpp into your working directory.
-
In the working directory compile the file GoodDocsF.cpp using the following command:
g++ -o GoodDocsF.exe GoodDocsF.cpp
-
In the working directory, type GoodDocsF and observe the results. Note: the original program was purposely designed to produce temperature conversions with incorrect results.
-
Open the file GoodDocsF.cpp in a text editor (e.g., Notepad) and modify the formulas as required to ensure correct output.
-
Save the corrected file as GoodDocsF2.cpp in the working directory.
-
Compile GoodDocsF2.cpp and generate GoodDocsF2.exe using the following command:
g++ -o GoodDocsF2.exe GoodDocsF2.cpp
-
Run GoodDocsF2.exe by typing the command GoodDocsF2 to verify the output corresponding to the correct result.
-
Submit the following complete programs to your Academic Expert for marking. Place all programs or files into one zipped folder, such as project1.zip, and submit it using the drop box on the course home page.
- GoodDocsF.cpp
- GoodDocsF.exe
- GoodDocsF2.cpp
- GoodDocsF2.exe