{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Thorndale};}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
{\f91\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Thorndale};}{\f92\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Thorndale};}{\f94\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Thorndale};}
{\f95\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Thorndale};}{\f96\froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Thorndale};}{\f97\froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Thorndale};}
{\f98\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Thorndale};}{\f107\fmodern\fcharset238\fprq1 Courier New CE;}{\f108\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f110\fmodern\fcharset161\fprq1 Courier New Greek;}
{\f111\fmodern\fcharset162\fprq1 Courier New Tur;}{\f112\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f113\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f114\fmodern\fcharset186\fprq1 Courier New Baltic;}}{\colortbl;\red0\green0\blue0;
\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \snext0 Normal;}{
\s1\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext15 heading 1;}{\s2\ql \li0\ri0\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\b\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon0 \snext0 heading 2;}{\*\cs10 \additive Default Paragraph Font;}{\s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 
\snext15 Default;}{\s16\ql \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext16 Text body;}{\s17\ql \fi-283\li567\ri0\sa120\nowidctlpar
\tx567\aspalpha\faauto\rin0\lin567\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon16 \snext17 Hanging indent;}{\s18\ql \li0\ri0\sb240\sa120\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext16 Heading;}{\s19\ql \fi-360\li360\ri0\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext19 List;}{
\s20\ql \fi-360\li720\ri0\nowidctlpar\aspalpha\faauto\rin0\lin720\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext20 List 2;}{\s21\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 
\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext21 header;}{\s22\ql \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon16 \snext22 Table Contents;}{
\s23\qc \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\i\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon22 \snext23 Table Heading;}{\s24\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext24 Index;}{\s25\qc \li0\ri0\sb240\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\fs32\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext26 Title;}{
\s26\qc \li0\ri0\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext16 Subtitle;}{\s27\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 
\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext27 footer;}{\s28\ql \li0\ri0\sb120\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \i\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon15 \snext28 caption;}{\*
\cs29 \additive \cf1\lang0\langfe255\langfenp255 Numbering Symbols;}{\*\cs30 \additive \cf1\lang0\langfe255\langfenp255 WW-Default Paragraph Font;}{\*\cs31 \additive \cf1\lang0\langfe255\langfenp255 \sbasedon30 page number;}}{\info{\author CNRS}
{\operator CNRS}{\creatim\yr2003\mo8\dy29\hr23\min17}{\revtim\yr2003\mo11\dy7\hr9\min44}{\printim\yr2003\mo10\dy10\hr9\min12}{\version4}{\edmins6}{\nofpages4}{\nofwords2017}{\nofchars11500}{\*\company CNRS-HSU}{\nofcharsws14122}{\vern8269}}
\margl1083\margr1083\margt1400\margb720 \widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl 
\fet0\sectd \sbknone\linex0\headery709\sectdefaultcl {\header \pard\plain \s21\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\fs16 CS 131 - Homework #9\tab \tab p. }
{\field{\*\fldinst {\fs16 \\page}}{\fldrslt {\fs16\lang1024\langfe1024\noproof 4}}}{
\par }{\fs16 Fall 2003
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s15\qc \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b CS 131 - Intro to Computer Science I - Fall 2003
\par LAB #9 EXERCISE and Homework #9
\par 
\par lab #9 exercise due: Friday, November 7th, END of lab
\par HW #9 due: Friday, November 14th, }{\b\ul beginning}{\b  of lab
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b 
\par }{
You are to work individually on this assignment, and you will turn in the specified files by e-mail (one file per e-mail message, with the contents included in the text and not as an attachment, and with a copy CC'd to yourself as your receipt) as you hav
e been doing since CS 131 HW #6.
\par }{\b 
\par }{NOTE: you are always welcome to write additional auxiliary functions for homework problems --- do be sure to e-mail me such functions if you do so, however! Just also let me know which problem(s) they are for.
\par }{\b 
\par }{\b\ul LAB #9 EXERCISE
\par }{\b 
\par }{Y'know what? Between testAll4.cpp and crunchGrades.cpp, you may have noticed that compiling gets to be a bit of an annoyance when you have a lot of different files involved. The answer is not to cram all of the functions into fewer files, however --- 
that is far less versatile. No, a better answer is a file called a }{\b makefile}{, used with the }{\b make}{ command.
\par }{\b 
\par }{In Unix, if you have a file in a directory named, literally, }{\b makefile}{, then a command called }{\b make}{ can be used to update given files that have changed by using given commands, all stored in the makefile
. What does this mean to us? It means that if we list the executable for a program and all of its needed .o files, list next to each of these the files that it depends upon, and put after each file and its
 list the g++ command to recompile it, then, when you call make, it sees if any file that another depends upon has been changed. If so, then it runs the appropriate command(s) to update the object files and executable files that need them.
\par }{\b 
\par }{Now, please not
e: the format of a makefile is pretty darn specific --- that's why making sure you get one working will be today's lab exercise. 8-) You have to have a colon (:) after each executable or object file name, giving the files it depends on, and the command to
 recreate it must be on the next line, preceded by a tab. I *think* that it is not very tolerant of extra line breaks, either --- just let the line wrap, and if you are pasting, *remove* any line breaks that are helpfully "inserted" on your behalf...

\par }{\b 
\par }{(Also, you don't have to call the file makefile --- it can have a different name, if you don't mind giving that filename in the make command. Typing:
\par }{\f2 make
\par }{...will cause the system to look for a file named makefile. Typing...
\par }{\f2 make -f  myDiffMake
\par }{...will cause the system to do the same actions with a file named myDiffMake instead...)
\par }{\b 
\par }{Consider }{\b testAll4.cpp}{, then, from HW #5. It needed profit.o, attendees.o, revenue.o, cost.o, and isFunctAbbrev.o, right? Well, here is a makefile for testAll4:
\par }{\b 
\par }{\fs18\loch\af2 \hich\af0\dbch\af0\loch\f2 testAll4 : testAll4.o\hich\af0\dbch\af0\loch\f2  profit.o attendees.o revenue.o cost.o isFunctAbbrev.o
\par \hich\af0\dbch\af0\loch\f2         g++ -o testAll4 testAll4.o profit.o attendees.o revenue.o cost.o isFunctAbbrev.o
\par 
\par \hich\af0\dbch\af0\loch\f2 testAll4.o : testAll4.cpp profit.h attendees.h revenue.h cost.h
\par \hich\af0\dbch\af0\loch\f2         g++ -c testAll4.cpp
\par 
\par \hich\af0\dbch\af0\loch\f2 isFunctAbbrev.o : isFunctAbbrev.cpp
\par \hich\af0\dbch\af0\loch\f2         g++ -c isFunctAbbrev.cpp
\par 
\par \hich\af0\dbch\af0\loch\f2 profit.o : profit.cpp revenue.h cost.h
\par 
\par \hich\af0\dbch\af0\loch\f2         g++ -c profit.cpp
\par 
\par \hich\af0\dbch\af0\loch\f2 revenue.o : revenue.cpp attendees.h
\par \hich\af0\dbch\af0\loch\f2         g++ -c revenue.cpp
\par 
\par \hich\af0\dbch\af0\loch\f2 cost.o : cost.cpp attendees.h
\par \hich\af0\dbch\af0\loch\f2         g++ -c cost.cpp
\par 
\par \hich\af0\dbch\af0\loch\f2 attendees.o : attendees.cpp attendees.h
\par \hich\af0\dbch\af0\loch\f2         g++ -c attendees.cpp
\par }{\b\fs18\loch\af2 
\par }{The g++ commands should look very familiar --- except for using }{\b testAll4.o}{ instead of }{\b testAll4.cpp}{ in the final linking and creation of the executable program, they are the same g++ comm
ands that you typed in to create all of these in HW #5. The first lines are a bit different --- the line for the dependencies for the  final executable program only seems to list .o files that it requires, while thelines for the .o file dependencies seem 
to require .h files that they need, also (but not standard libraries). We may have to experiment with these a bit, but the above makefile does appear to work in my tests.
\par }{\b 
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {So --- I want you to make a makefile for program }{\b crunchGrades}{, from HW #8. Note that 
you are welcome to use the versions posted to the course Blackboard site, under "Some Solutions". (In fact, if you have any doubt about any of your versions, then please use the posted versions instead.)
\par 
\par You'll need files }{\b crunchGrades.cpp}{, }{\b avgGrades.cpp}{, }{\b countPassing.cpp}{, }{\b minGrade.cpp}{, }{\b maxGrade.cpp}{
. (You'll also need the header files for the auxiliary functions --- all but crunchGrades.cpp --- but you should know how to generate those, at this point.)
\par 
\par Make a makefile, either named makefile or using anothe
r (obvious) name of your choice, for this program. Change one of the .cpp or .h files in a way that will be apparent, and run the appropriate make command. When you run the program, do you see the change? If so, then call me over, and I'll test your makef
ile.
\par 
\par If you have a properly-operational makefile that I have successfully tested before the end of lab on November 7th, then you have completed the lab exercise for full credit. And you'll also have a makefile ready to be used and modified for HW #9...
\par }{\b 
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b\ul HOMEWORK #9:
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b\ul 
\par }{Consider }{\b crunchGrades.cpp}{ from HW #8, question #3. Thanks to the lab exercise, you should now have copies of all of the files with the needed auxiliary functions for this program, along with a makefile to better deal with all of the different
 functions that make up (and will be added to!) this program.
\par }{\b 
\par 1.\tab }{Copy }{\b crunchGrades.cpp}{ into a new file }{\b newCrunch.cpp}{, and change your makefile accordingly. Use }{\b make}{ to then create a "base" version of }{\b newCrunch}{ --- does it work? Make sure that it does...}{\b 
\par 
\par \tab }{(You will eventually mail me your resulting makefile, but do not do so yet. You'll be modifying it in the later problems.)
\par }{\b 
\par 2.\tab }{You may notice, in my solution to }{\b crunchGrades.cpp}{, that  I didn't re-print the entire menu of options before asking the user fo
r later choices --- I only did so for his/her first choice. I really should have, so let's do so in a less painful, more elegant manner, that will also let you practice a simple example of pass-by-reference.}{\b 
\par 
\par \tab }{Write a new function }{\b getNextChoice}{ (in file ge
tNextChoice.cpp), that is an input function. It should not return anything, but it will change its single pass-by-reference parameter (an output parameter, in this case) to be whatever character the user types after being shown the menu of options and ask
ed for his/her choice. (So, yes, getNextChoice will include printing the menu of possible options.)
\par }{\b 
\par \tab }{Then, modify newCrunch to use this new function appropriately, and modify its makefile to reflect this new dependency. Note that the next choice's menu mig
ht keep the desired result from being seen --- you should also add to newCrunch, after one result and before the next choice's menu, a "pause" before going on --- code such as the following will work (as was seen in one of the in-class examples):
\par }\pard \s15\ql \fi-420\li825\ri0\nowidctlpar\aspalpha\faauto\rin0\lin825\itap0 {\b \tab }{\b\f2 cout << endl << "type any character to continue: ";}{\b 
\par }{\b\loch\af2 \tab \hich\af0\dbch\af0\loch\f2 cin >> dontCare;     // declare dontCare to be of type char...
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b 
\par \tab }{(No, don't mail me getNextChoice.cpp yet, either. It too will undergo changes before the assignment is over.)
\par }{\b 
\par 3.\tab }{We've now discussed the }{\b switch }{statement, also, and switch statements do work well for menus. Modify }{\b newCrunch.cpp}{ to make appropriate use of a }{\b switch}{ statement.}{\b 
\par 
\par INTERLUDE:
\par \tab }{I just realized that there was one important aspect of file input that we did not discuss in lecture. In all of o
ur file input examples, we went in assuming exactly how much information would be in the file. There are many situations where we would like to be able to read the contents of files where the exact quantity in the files is not known in advance. How can we
 do this using an iostream input stream?}{\b 
\par 
\par \tab }{It turns out that there are two ways, but I'll mention just one of them for now. (Savitch Ch. 5 has information about both.)
\par }{\b 
\par \tab }{
Interestingly enough, the same expression that we use to read something from an input stream into a variable --- myInputStream >> myVariable --- also results in a boolean value: from a Savitch footnote on p. 258, "true if the stream is able to extract dat
a, and false otherwise". This means that a loop such as the following actually works:
\par }{\b 
\par \tab }{\f2 while (in_stream >> nextVal)}{
\par }{\loch\af2 \tab \{
\par \tab \hich\af0\dbch\af0\loch\f2     cout << nextVal;
\par \tab \}
\par }{\b\loch\af2 
\par \tab }{That is, the stream tries to read a value into nextVal. If successful, the loop condition's value is true, and
 you enter the loop --- print the value. Then the stream tries to read another value into nextVal, and if successful, that's another true value, and again you enter the loop. When the stream is unsuccessful  in reading a value into nextVal --- because the
re's no data left in the file --- then the loop condition is false, and you exit the loop.}{\loch\af2 
\par }{\b 
\par \tab }{This suggests a klugy, ugly way to solve the problem of how we might read values from a file into an array without knowing how many values are in the file (there mu
st be a cleaner way, but this ugly way works with what we know right now, pre-pointers! 8-) )
\par }{\b 
\par \tab }{Step 1: write a counting-values-in-file function, that simply counts the number of values in a file. Do you see that you should be able to modify the above loop so that it would count the number of values read in, instead of printing them out?

\par }{\b 
\par \tab }{Step 2: Then, once you know the number of grades in the file, you could declare an array of the proper size, and then read the grades into that array.
\par }{\b 
\par \tab }{(Hopefully, you a
lso see why this is an ugly kluge --- it is inherently just not "pretty" to open and read the file values twice, just to be able to get them into an array. But it does give you some easy file I/O practice, which is what we want right now... 8-) Just be aw
are that we'll generally seek prettier solutions and algorithms, when we can!)
\par }{\b 
\par 4.\tab }{So, here are the specifications for a function }{\b countGrades, }{which should be in file }{\b countGrades.cpp}{:it will take two arguments, a char[ ], or old-style c string, and a pass-b
y-reference int parameter. It will set that pass-by-reference int parameter to the count of the number of double values that it reads from the file with the name given by the first parameter. Ah, but what if there are problems opening the file with the gi
ven file name? Instead of making this a }{\b void}{ function, we'll have it return an int --- }{\b 0}{ if the file could be opened and read successfully, and }{\b 1}{ if the file cannot be opened for reading.
\par }{\b 
\par \tab }{(helpful hint: what should you set your pass-by-reference variable to before beginning your loop\'85?)
\par }{\b 
\par \tab }{To add this to newCrunch, note that we will be changing the initial
 interaction with the user. Before, it asked the user how many grades there would be, and then prompted the user for that many --- now, it will prompt the user for the name of a file (that the user has created in advance!) where the grades can be found. I
f countGrades returns a 0, newCrunch can proceed --- but if it returns 1, then newCrunch should complain and exit.
\par }{\b 
\par \tab }{(Note that, on newCrunch.cpp's side, you should declare the filename as a specific-length char array. That is,
\par }\pard \s15\ql \fi-420\li840\ri0\nowidctlpar\aspalpha\faauto\rin0\lin840\itap0 {\tab }{\f2 char inFileName[25];}{
\par 
\par You should then be able to cin into inFileName with no problem. See }{\b io7.cpp}{, soon to be posted, for an example of this.)
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\b 
\par 5.\tab }{And, here are the specifications for }{\b fillGradesArray}{, which should be in file }{\b fillGradesArray.cpp}{
: it will take three arguments, a char [ ] (old style c string), a double array, and an int giving the number of elements in that array. It will try to read the file with the given name, and try to read the first number-of-elements given from the file wit
h the given name into the given array. Now, we know very well that this should work, since we are calling}{\b  }{
it after countGrades has counted the contents for us --- but, for generality, we'll have fillGradesArray also return 0 if the file can be opened for reading successfully, and 1 if it cannot.
\par 
\par \tab Now newCrunch can call fillGradesArray if all goes well with countGrades, creating a grades array of the proper size using the information from countGrades and using it as one of the arguments to fillGradesArray.
\par 
\par \tab Remember to update your makefile appropriately for these...\tab 
\par }{
\par }{\b 6.\tab }{But --- you know, the user might want to *see* the grades read from the file. We'd better add another function, displayGrades, (in file displayGrades.cpp
) that takes the array and its size, and prints its contents nicely to the screen. You know, right-justified, and with the same number of fractional places --- let's make it print out the grades as so:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 grade # 1: 100.0
\par \hich\af0\dbch\af0\loch\f2 grade # 2:  78.6
\par \hich\af0\dbch\af0\loch\f2 grade # 3:   0.5
\par \hich\af0\dbch\af0\loch\f2 gr\hich\af0\dbch\af0\loch\f2 ade # 4: 100.0
\par \hich\af0\dbch\af0\loch\f2 grade # 5:  99.3
\par \hich\af0\dbch\af0\loch\f2 grade # 6:  78.0
\par \hich\af0\dbch\af0\loch\f2 grade # 7:   3.7
\par \hich\af0\dbch\af0\loch\f2 grade # 8: 100.0
\par \hich\af0\dbch\af0\loch\f2 grade # 9:  88.8
\par \hich\af0\dbch\af0\loch\f2 grade #10:  47.6
\par 
\par }\pard \s15\ql \fi-420\li840\ri0\nowidctlpar\aspalpha\faauto\rin0\lin840\itap0 {(Yes, we are assuming that grades never exceed 999, and that there will not be more than 99 grades.)
\par 
\par }\pard \s15\ql \fi-420\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {\tab To test displayGrades, make it opti
on '5' in the menu that is shown to users. Note that you will need to modify both getNextChoice, newCrunch, and newCrunch's makefile appropriately for this to work.
\par 
\par 6.\tab We need to practice file OUTPUT, too! So, we need a function }{\b createGradesReport}{ (in file }{\b createGradesReport.cpp}{
) that will print a report about the grades. It should be formatted as so (X's below indicate expected size of the output field... you won't literally print X's, you'll print a properly-formatted computed value at that point).
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 GRAD\hich\af0\dbch\af0\loch\f2 E REPORT
\par \hich\af0\dbch\af0\loch\f2 -----------------
\par \hich\af0\dbch\af0\loch\f2 # of grades: XX
\par \hich\af0\dbch\af0\loch\f2 # passing  : XX
\par 
\par \hich\af0\dbch\af0\loch\f2 Average    : XXX.X
\par 
\par \hich\af0\dbch\af0\loch\f2 Highest    : XXX.X
\par \hich\af0\dbch\af0\loch\f2 Lowest     : XXX.X
\par 
\par \tab }{Its arguments should be a char [ ] (old-style c string) representing the filename where the report should be written, the array of grades, and the size of the array.}{\loch\af2 
\par }{
\par \tab And, of course, an option '6' for this needs to be added to }{\b getNextChoice}{ and }{\b newCrunch}{, and }{\b newCrunch's}{ }{\b makefile}{ needs to reflect this final new dependency.
\par }{\uldb 
\par }{\tab Now it should be safe to send me all of the final versions of your functions, and your final makefile.}{\uldb 
\par }{\b 
\par }\pard \s15\ql \li-15\ri0\nowidctlpar\aspalpha\faauto\rin0\lin-15\itap0 {When you are done with this homework, you should have sent me at least }{\b 7}{ e-mail messages, one each for: your final }{\b makefile}{ for newCrunch, and your final versions of }{
\b newCrunch.cpp}{, }{\b getNextChoice.cpp}{, }{\b countGrades.cpp}{, }{\b fillGradesArray.cpp}{, }{\b displayGrades.cpp}{, and  }{\b createGradesReport.cpp}{.
\par 
\par }\pard \s15\qc \fi-435\li435\ri0\nowidctlpar\aspalpha\faauto\rin0\lin435\itap0 {\b 
\par }}