Purpose of This Lab Work:
The purpose of this lab work is to have experience with C preprocessor and
makefile.
You should create the following files:
network.h
cable.h
wireless.h
main.c
Expected contents of these files are specified below:
network.h: Define two macros named CABLE and WIRELESS. Depending on
whether values of these macros are one or zero, the output will change.
cable.h: Define a macro called CONNECTION with the value of "CableOn".
wireless.h: Define a macro called CONNECTION with the value of "WiFiOn".
main.c: Create a main function in which you carry out the following
operations:
Implement a conditional macro structure. If CABLE is 1, cable.h will be
included. If WIRELESS is one, wireless.h will be included. If both CABLE and
WIRELESS are zero, define the macro CONNECTION with the value of "Unable
to connect Internet". (do not need to consider the case both CABLE and
WIRELESS are 1)
Display the value of macro CONNECTION. Depending on the values of
macros (CABLE and WIRELESS) you are expected to observe the output for
three different cases as below:
Connection Statue: CableOn (if CABLE is 1 and WIRELESS is 0)
Connection Statue: WiFiOn (if CABLE is 0 and WIRELESS is 1)
Connection Statue: Unable to connect Internet (if both CABLE and
WIRELESS are zero)