YCP Logo Lab 29: Compiling using gcc

Due: Friday, December 5th by 11:59 PM

Getting Started

Download CS200_Lab29.zip.

Extract the contents of the zip file into the root folder of the H: drive. This should create a directory called CS200_Lab29.

Start Notepad++ (Start->All Programs->Programming->Notepad++). Open the file H:\CS200_Lab29\main.c.

Your Task

Without changing the code in main.c, compile main.c into an executable called calc.exe. When executed, the calc.exe program accepts floating point values and character operation codes from the user, and performs the indicated arithmetic operations, updating an accumulator value.

Example transcript:

= 0.00
3.5 +
= 3.50
2 *
= 7.00
4 *
= 28.00
4 +
= 32.00
2 /
= 16.00
0 q

You should create two new files, operations.h and operations.c. Use Notepad++ to edit them. The operations.h header file should contain function prototypes for functions used, but not defined, in main.c. The operations.c source file should contain the definitions of the functions whose prototypes you placed in operations.h.

Compile your entire program using gcc from the Cygwin bash shell (Start->Programming->cygwin->Cygwin bash shell). You may find it useful to refer to the notes for lecture 23.

Important: When compiling source (".c") files into object (".o") files, make sure you use the -Wall and -Werror command line options. Your program must compile without any compiler warnings.

Once you have compiled and linked calc.exe, you can run your program using the command



Create a zip file of your solution by navigating to the CS200_Lab29 folder in your H: drive, right-clicking, and choosing Send to->Compressed Folder.

Upload the zip file to the submission server as lab29. The server URL is