If you want to make sure that I will be able to collect your
file, type
Assign1
and hit enter. You should get a message back telling you
that your file was found.
If you want to make sure that I will be able to collect your
file, type
Assign2
and hit enter. You should get a message back telling you
that your file was found.
If you want to make sure that I will be able to collect your
file, type
Assign3
and hit enter. You should get a message back telling you
that your file was found.
You might want to test that your program behaves correctly under several situations. If all lines have the same length, the next longest is empty (not even a '\n'). Be sure that if you have two or more lines of longest length your program doesn't print out some occurrence of the longest line. Be sure it works if there are several lines of "next longest" length. Finally, be sure it handles cases where the longest line comes before the next longest and cases where it somes after.
If you want to make sure that I will be able to collect your
file, type
Assign4
and hit enter. You should get a message back telling you
that your file was found.
Be sure you handle strings like
+-6
correctly (first you do the + and then you push -6).
The issue here is that when you see a '+' or a '-' you don't yet know what to do and you won't until you read the next character. Since you are not allowed to alter any of the other files that make up the calculator program, you have to handle all the issues here.
Modify the word_count.c program to accept command line arguments.
Call the new file Word_count.c and alter main as follows.
main should now accept command line arguments. If there are none,
the program should print out the alphabetical-order tree. If there
is a '-n' the program should print out the numerical-order tree;
if there is a '-a' the program should print out the alphabetical-order
tree. Multiple flags should be supported, so
a.out -ana
should print the tree 3 times, first in alphabetical order, then
in numerical order and finally in alphabetical order again.
The line
a.out -a -n -a
should produce the same result as should either
a.out -an -a
or
a.out -a -na
Your program should just ignore any command line arguments that
it does not recognize. No error messages, etc. so
a.out Im not a moose
should be the same as no arguments and so should print the tree in
alphabetical order. It used to read I'm not a moose, but I forgot
that UNIX does weird things with certain characters on the command
line, in particular apostrophes. Your program never got a chance to
run.
Also
a.out -acv-na
should print the tree alphabetically, ignore the c, ignore the v, ignore
the -, print the tree numerically and finally print the tree alphabetically.
You should also print one copy of the list alphabetically if you
have command line arguments which begin with -'s but no a's
or n's. So for example
a.out -xvxvx -yuytr -popiu
should print the list alphabetically once.
You can test your program by typing
a.out -anana -ahna < test_file
or whatever. The command line ends at the < so argc=3 in the example and
the three C-strings are 'a.out', '-anana' and '-ahna'.
Fix your assignment 6 if it wasn't right. If it wasn't right your code should be included in the email I sent you. Look for LRT's for my comments.
Change your Word_count.c file from Assignment 6
so that no matter what is typed on
the command line you print at least one copy of the alphabetical
list and one copy of the numerical list.
In more detail, when you are done processing the command line arguments
just as in Assignment 6, you need to be able to check if you have
printed any copies of the list alphabetically. If you haven't, print
one now. THEN check if you have printed any numerical copies. If not,
print one now.
Add a function to the quaternion class file "quat.cc". This function
calculates the conjugate of a quaternion so the declaration should be
void conj(quat);
The invocation
Q1.conj(Q2);
should cause the conjugate of the quaternion Q2 to be put into the
quaternion Q1.
Assignment 8
Due midnight Friday, April 26.
Back.