DukeDisc
that will contain all of the drivers and the different versions of
the various classes. Where you put this directory is up to you.
Inside of the DukeDisc
directory/folder you must
have six subdirectories/subfolders named v1
,
v2
, v3
, v4
, v5
,
and v6
.
You must:
Slot.h
and Slot.cpp
into the v1
directory.DiscChanger.h
and DiscChanger.cpp
into the v1
directory.Driver1.cpp
and put in in the DukeDisc
directory.
This driver is identical to the one used in PA2 except:
PROMPT
symbol has been replaced with
a bool
variable named prompt. Hence,
you can no longer control the "verbosity" at compile time.
#include
s the DiscChanger
class in the v1
subdirectory.DiscChanger
class so that it
no longer uses the SIZE
symbol and instead
uses an int
variable named size
.
This involves:
Slot
array variable in the header. Instead of using
the SIZE
symbol it must be
hard-coded to a dimension of 6.int
named
size
to the header.size
to 6 in all constructors
(in the .cpp
file).
size
in place of the
symbol SIZE
in the .cpp
file.make
utility since
the files will be in many different directories.
The following makefile
may prove to be useful in this
regard:
# Phony target to build all versions # all: v1 # Phony targets for each version # v1: Driver1 # Drivers # Driver1: Driver1.o v1/DiscChanger.o v1/Slot.o g++ Driver1.o v1/DiscChanger.o v1/Slot.o -o Driver1 Driver1.o: Driver1.cpp v1/DiscChanger.h g++ -c Driver1.cpp # v1 of DiscChanger and Slot # v1/DiscChanger.o: v1/DiscChanger.cpp v1/DiscChanger.h v1/Slot.h g++ -c v1/DiscChanger.cpp -o v1/DiscChanger.o v1/Slot.o: v1/Slot.cpp v1/Slot.h g++ -c v1/Slot.cpp -o v1/Slot.o
The makefile
must be in the DukeDisc
directory. You can build version 1 of DukeDisc with the command
make v1
(assuming the DukeDisc
directory
is your working directory).
You must keep all test files in the DukeDisc
directory
and must execute the driver(s) from that directory.
Copyright 2010