CSCI 3342 Submission 04
Gathering Odds and Evens
Supplied file(s) |
$sup04/demo_gather_odds_evens (the demo executable)$sup04/gather_odds_evens.o (the pre-compiled driver)$sup04/functions.h (the specification file for the
functions you must write) $sup04/build.sh (a shell script for creating/building your
executable)
|
---|---|
Files to submit |
functions.cpp (the source code file containing your
function definitions)gather_odds_evens (your executable)my_tests.sh (your testing script)
|
Where to put them |
Copy them to your u##/submissions/s04 directory.
|
When they're due | Sunday, February 23, 2025 @11:59pm |
This week's submission provides an opportunity to put your knowledge of the STL to work, and to write some code that must compile and link with an instructor-provided, previously-compiled main program driver to form the final executable.
Your job will be to implement the functions whose interfaces have been given
in the functions.h
specification file, and you will have an
opportunity to use the STL in various ways in the development of these
functions. All of the functions you write must be placed in a file called
functions.cpp
, which will then be separately complied and
linked with the instructor-supplied driver file
gather_odds_evens.o
to produce your final executable file
gather_odds_evens
.
functions.h
file) to see what functions you have to write. It contains a prototype for
each of the required functions, along with doxygen-style documentation. We
have already discussed the doxygen documentation that you see in this file
and noted that it is very similar to the javadoc documentation that you
are familiar with from working with Java. So, as you know, you can
document your C++ code in much the same way you can document your Java
code, and also produce a similar HTML version of that documentation. But,
also as you know, we are not requiring you to fully document your code
using this kind of doxygen-style documentation, but it should be helpful
for you to see it being used here in context.
uxx
account.
functions.cpp
file
extern const string MY_ID_INFO = "\t\tLastname:Firstname:A00123456:u??";which, of course, contains your information, and not the generic information shown.
DisplayProgramInfo()
function, you must have
just two C++ statements in the function body: one cout
statement to output a C++ raw string containing the
entire content of the program information screen except for the pause at
the end, and a second statement that calls the Pause()
function to produce that pause at the bottom of the screen.
In your GatherOddsInDequeEvensInList()
function you are
not permitted to use any loops, which
means that the moving around of values must be accomplished solely by
appropriate STL algorithms and/or container methods.
Hint: STL features that you may find useful include the
algorithms copy()
, copy_if()
,
sort()
and unique()
, the functional object
greater<>()
from the <functional>
header,
and the output iterator ostream_iterator<>()
from the
<iterator>
header. Appropriate use of these STL features
is, of course, how you avoid the use of any loops in the function
mentioned above.
build.sh
script
to build your executable for testing during development, and eventually
for building the the final version of the executable for submission. And
once again you will also need a testing script to test each iteration of
the executable as you develop the program, and this testing script is also
one of the files to be submitted.