CS 211 - Programming Practicum

Lab 13

Due: Monday, 12/3/12 at 11:59 pm

Use of Multiple Source Code Files

For this assignment take the blackjack program what was written in a single source code file and break it into 3 source code files.

The first source code file must contain only the following functions:

  • evaluateHand ()
  • main()
The second source code file must only contain the following functions:
  • printDeck ()
  • shuffle ()
  • initDeck ()
The third source code file must only contain the following functions:
  • dealerBlackJack ()
  • playHand()
The source code files may include any "non-function" code as needed.

The original program is: bj.c

You must also create a header file and a makefile for this assignment. You must submit all five of these files for grading. Missing any of these five files will impact the grade for this assignment.

The makefile MUST seperately compile each source code file into a ".o" file and separately link the ".o" files together into an executable file.

Example of Multiple Source Code Files

Consider the program contaied in the following files: This example shows how to set up this simplest of multiple source code file program. Note that max3a.c and max3b.c just contain functions and a #include of max3.h. The file max3.h contains the prototypes (or forward declarations) for all of the the functions that are called from outside its source code file and any "globally" needed information.

The makefile is a special file that helps in the compilation of the source code into the object files into the executable file. A make file is executed by the use of the make command. Make and makefile tutorials can be found at:

Program Submission

Your are to submit the five files for the program for this lab via the Assignments Page in Blackboard.

To help the TA, name your file with your net-id and the assignment name.

Submit this file via the Assignment Link for the Lab in Blackboard.

  1. In the CS 211 Web Pages in Blackboard, go to the Assignments Page
  2. Click on the link for the correct lab. This will open a web page with the title: "Upload Assignment: Lab X", where X is the number of the lab
  3. Scroll down and click on the button "Browse for Local File"
  4. Select the first file that you created that contains the program. Then click OK.
  5. Repeat steps 3 and 4 for your remaining files.
  6. Click the submit button on the "Upload Assignment: Lab X" page.
  7. You should see the Submission History page that shows what you submitted. Verify you actually submitted the correct information.
-- Main.troy - 2012-11-28
Topic attachments
I Attachment Action Size Date Who Comment
C source code filec bj.c manage 4.9 K 2012-11-28 - 15:12 UnknownUser  
Unknown file formatEXT makefile manage 0.1 K 2012-11-28 - 15:29 UnknownUser  
Header fileh max3.h manage 0.1 K 2012-11-28 - 15:29 UnknownUser  
C source code filec max3a.c manage 0.1 K 2012-11-28 - 15:29 UnknownUser  
C source code filec max3b.c manage 0.1 K 2012-11-28 - 15:29 UnknownUser  
Topic revision: r1 - 2012-11-28 - 15:40:24 - Main.troy
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
Helping Women Faculty Advance
Funded by NSF