CSCI 3342 Submission 03
Displaying ASCII Characters and Codes, Part 3
Supplied file(s) |
demo_display_ascii3 (the demo executable)display_ascii3.txt (the "TextItems" file containing program
information)
|
---|---|
Files to submit |
display_ascii3_main.cpp (the source code for your main
driver)display_ascii3_functions.cpp (the source code for your
two auxiliary functions)display_ascii3 (your executable) AsciiGenerator.h (your class specification file)AsciiGenerator.cpp (your class implementation file)No my_tests.sh required this time ... see below. |
Where to put them |
Copy them to your u##/submissions/s03 subdirectory.
|
When they're due | Sunday, February 9, 2025 @11:59pm |
This third submission is Part 3 (and the last part) of our three-part exercise for generating and displaying ASCII code ranges.. This time the functionality of the program will remain essentially the same as in the previous version, which means that you can reuse all of your code that displays the ASCII codes, but the interface and the overall program structure will be quite different. In the previous version we introduced a module of separately-compiled functions into the program and saw how to combine those with a main driver to produce the final executable. This time you will also have a module of separately-compiled (but different) functions.
However, instead of taking its input from the command line, this version of
the program will be menu-driven, so the user will be prompted to enter the
required input from the keyboard. And "behind the scenes" you will have a
new C++ class called AsciiGenerator
which will contain the code
that produces the tables of ASCII characters and their corresponding codes,
in both formats as before. In other words, most of the code in this this new
class should be code that you have already written.
You must continue using the DisplayOpeningScreen()
function,
the Pause()
function, and the TextItems
class in
the same way as in the previous submissions. And now, foṙ this submission,
you must also use the Menu
class from the instructor-supplied
utilities
module to provide a menu for the program and get the
user's menu choice when the program runs. You will also find the
ReadChar()
and userSaysYes()
free functions from
that same utilities
module quite helpful in this program.
demo_display_ascii3
), as well as the companion "TextItems"
program information file (display_ascii3.txt
) that goes with
it.
ReadChar()
function from the utilities
module to
read the character). Experiment with the menu itself as well, by entering
invalid options (for example). The behavior you see when you do this is
built into the Menu
class, and not something you have to
implement (except for what your program does when the user fails to enter
a valid menu choice after three tries).
AsciiGenerator
class (in AsciiGenerator.h
and AsciiGenerator.cpp
) only needs a constructor that takes
in as parameters the two characters that determine the ASCII range to
display and records them in private instance variables of the class, and
two methods to display the characters and their codes in the two formats.
display_ascii3_functions.cpp
file. As in the previous
submission, prototypes for these functions must be placed in the main
driver file display_ascii3_main.cpp
.
uxx
account.
ReadChar()
free function from the instructor-supplied
utilities module. If you use that function to read the input when the user
is prompted for one of the characters to determine the range of values in
the displayed table, more than one character may be entered but only the
first character is taken as the entry, and the remaining characters are
ignored.
my_tests.sh
testing script required. Obviously this must not
be taken as meaning your program does not need to be tested! Clearly you
should put your program through the same tests as before, but because the
program is now menu driven it is more difficult (though not impossible) to
use a testing script that simply runs and performs all the necessary
tests. Thus your testing this time around will require running the program
and entering the input (both valid and invalid, of course) from the
keyboard.
Choose ASCII character end points for the range of values you wish to display. Both end point characters must lie in the range of characters from ' ' to '~'. Also, the start character must precede the end character in the ASCII sequence. Enter start character for the table display: Enter end character for the table display (>= previous value): Error: The starting character for the table display must not follow the ending character in the ASCII sequence. Try again.