(Latest Revision: February 8, 2015)
FIRST CS 1500 SOLO PROGRAM
Making ASCII Figures
THE ASSIGNMENT:
Write a program that prints the output depicted below.:
--- the output starts just below this line of text, but DOES NOT INCLUDE this line of text ---
============================================================
============================================================
|| -=[ fish ]=- 3/97 ||
|| ||
|| \ ||
|| }\ ||
|| `\ .' \ ||
|| }\/ ~~ o\ ||
|| }/\ )) _} ||
|| ,/ /`. /` ||
|| }/ ||
|| jgs / ||
|| -=[ auk ]=- 12/96 ||
|| .--. ||
|| / ,~a`-, ||
|| \ \_.-"` ||
|| ) ( ||
|| ,/ ."\ ||
|| / ( | ||
|| / ) ; ||
|| jgs / / / ||
|| ,/_."` /` ||
|| /_/\ |___ ||
|| `~~~~~` ||
============================================================
============================================================
--- the output ends just above this line of text, but DOES NOT INCLUDE this line of text ---
Your program is required to output everything between the delimiting lines
above (including the 'frame' and the blank lines), but not the delimiting
lines themselves. If you have any doubts about the meaning of the directions,
please ask me to explain further.
If you work smart with your editor it won't take long to write the program.
Ask me for some hints in class.
To re-familiarize yourself with the basic steps required for doing a
programming assignment, please refer to the
directions for the Hello World! practice assignment.
To see some sample code similar in structure to code you could write to solve
this problem, see
makebFly.cpp
Note About A Small Glitch: Some of the characters in the figures are
double-quote characters like this [ " ] and backslashes like this [ \ ]. If
you want to write a cout statement that causes a double-quote
character or backslash character to be written to the screen, then in your
code you have to precede the character with an escape character, to warn the
compiler not to interpret the special character with its usual special
meaning. C++ uses the backslash as the escape character.
For example, if you want your program to write this:
()()""++\--8
to the screen, you
have to put a statement like this:
cout << "()()\"\"++\\--8" ;
in your program. Notice that the second and third double-quote characters in
the example cout statement above are preceded with the escape
character - a backslash. The backslash is the character in this box: [ \
]. The placement of the escape character tells the compiler that we want
our program to write the second and third double-quote characters on the
computer screen, and that we DO NOT want them to be interpreted in the usual
way. (Usually a double-quote character in a cout
statement is used to delimit the start or the end of the string we want the
program to write to the screen.)
Also, when we actually want the program to write the escape character (the
backslash) to the screen, we place an initial backslash
before the backslash that we want to print, so that the compiler
will know what we want. That's why there are two backslashes in a row in the
cout statement above.
Another example:
cout << "\\" ;
prints one single backslash (the second one), and this statement:
cout << "\\\\" ;
prints just two backslashes (the second one and the fourth one).
WHAT TO TURN IN:
You will be sending me two e-mail messages. Please follow these
rules:
- Always send me e-mail as plain text in the main message body.
Never send me attachments.
- Always use the exact subject line I specify for each
message. This will assure that I am able to find your message. You will
lose a significant amount of credit for this assignment if you don't use
the correct subject line. (Read more about this below.)
- Be very careful when you send the e-mail. You may use the
instructions in your
Hello World! lab exercise
for guidance. Of course, you will need to make the obvious changes to
those directions -- you have to use the correct subject line and
filename.
- Always send yourself a copy of each e-mail message you send to me,
check immediately to see if you receive the message intact, and
check within a few minutes to see if you have received e-mail notifying
you about an undeliverable message. You are
responsible for sending e-mail correctly.
Here is the list of things you have to turn in:
- At the start of class on the due date
place the following item on the "counter" in front of me
- a hardcopy (printed listing) of your program (the C++ source code).
Make sure all the code is properly formatted and that it all shows
on the paper. If the paper has edges for the printer tractor, burst
them (tear them off on the perforations)
before giving them to me. The command to print a (text)
file is lp. So for example if you have a text file
named solo01.cpp,
you could print it with this command:
lp solo01.cpp
After you type the command the printout should come out of one of
the two dot matrix printers in the lab. Be careful to read
and exactly follow the directions on the printer for
removing your printout. (Please don't break the printer.)
The print jobs are queued so your job may not start coming
out of the printer right away. If there seems to be a problem
ask the lab assistant or the lab administrator (Deep Gill) to help.
- Before midnight on the the due
date send me the following by e-mail:
- A copy of the source code (C++ code) with subject line:
CS1500Prog1f
- and a (filtered) script showing a test run of the program,
with subject line:
CS1500Scrp1f
Note that there are no spaces in the subject lines given above. It is
important that you do not insert any spaces.
The easiest way to make sure you are using the
correct subject line is to just select, copy, and paste it into the
appropriate location. For example, if you are going to send the e-mail in the
manner described in the
Hello World! lab exercise,
then you would just paste the subject line into the appropriate part of the
command you type to send the e-mail.
My e-mail address is:
john@ishi.csustan.edu
DUE DATES:
For the due dates, see
the class schedule.
In case you are interested, I didn't create the ascii art I used for this
assignment. I found it somewhere on the world wide web. You can do a web
search using the keywords "ascii art collection" if you want to see more
examples. There is a profusion.