Be sure that only the file you want to submit is in that directory - make a directory for every assignment! Remember that the submit system will deliver every .cpp file in the current directory to me, so you should only have the file for hw 2 in that directory. Name your file a meaningful name and give it a .cpp extension since you will be compiling it. Also, make sure that you compile and run your program using the GNU (g++) compiler before submitting to make sure that it will work for the submit script.Background: This semester, you will be working as a software developer for a client who is a young, upcoming intellectual giant. In the programming assignments over the course of the next few months, Ralph Wiggum (pictured at right) will require your programming acumen and expertise, outlining what programs will make his life easier - something he dearly needs. Yes....he is your boss. Disturbing, isn't it. But I digress. Ralph now needs your help as he has found that eating inedible items from his school desk is causing a disconcerting decline in his (already pitifully low) IQ. He wishes to know how many IQ points he loses when he eats his school paste and sticks crayons up his nose. (Yes, yes, geniuses have peculiar habits.) Very fortunately, he hired Dr. Frink, the local egghead in his hometown Springfield, to develop the theory and subsequent formulation to calculate what he wants. Your job is to write a program in C++ that he can run on his computer (hence, he is the user) and it will tell him the loss in IQ points he will suffer when ingesting given amounts of paste and snorting known quantities of crayons.
Due: Friday, Feb. 7, 2014 at noon
Points Possible: 100 pts
For this assignment, you will submit a single C++ compilable file containing a program written in C++. Remember, to electronically submit a file to for this course, first change to the directory in which the file resides and then type in, at the UNIX prompt, the command:
cssubmit 53 section_letter assignment_number
number_of_crayons_in_nose is .... well .... you know,
The second term (SWGF x num crayons) is added in only if the user's father is indeed the chief of police.
The value computed on the right hand side of this formula is to be rounded down, always down.
Your program should be "user friendly" in that it should have an opening statement or greeting, user friendly and understandable prompts, and clear and concise outputs and sign-off. Here's a good example of bad output:
enter stuff: 65 4 1.7 2 0
5
SWGF is the StupidWiggumGenesFactor and is currently known to be 1.6,
iq is the user's intelligence quotient,
GLUE_POTENCY is a factor that describes the deleterious effects of glue on the brain; primary school glue is usually 20 and we'll assume that1.
paste is the number of oz of paste eaten,
where age is the user's age in years,
loss = (age / iq ) x ( GLUE_POTENCY x paste ) + (SWGF x number_of_crayons_in_nose),
Specifications: Your program is to begin with a welcome message to the user. It will then prompt the user for his age (an integer value), his IQ (an integer value), the amount (ozs) of paste he has consumed for this particular computation (a decimal value), the number of crayons he has stuffed in his nose, and whether or not his father is the police chief of Springfield. With this information, your program will compute the (rounded down integer value) number of IQ points lost given by the following formula:
Notice that there are NO prompts to speak of, and the output is completely unexplained. This is horrible output. Something like the following is much much better: Greetings ......welcome to this program that does ...... Please enter the following: your iq: 65
your age: 4
amount paste: 1.7
number crayons: 2
is your father the police chief (enter 1 for yes, 0 for no): 1
You will lose 5 IQ points.
Have a nice day!! Wow, everything is coming up Ralphy
Notice how everything is very clear? (Yes)
When you submit: When you submit this, and all subsequent programs for this class, cssubmit will compile and run (assuming it compiles) your program during the submission process. Thus, when you submit, you will have to enter inputs as a user of the program. Now, in order to make the output uniform for the grader and to keep them sane, ALL OF YOU will enter the same information. For this assignment, it is:
age is 6
IQ is 47
amount of paste 4.3 oz (chug it Ralph!)
3
1 = yes, father is indeed Chief Wiggum
Optional (without recompense2): If you think this assignment is too easy and should require more work from you, you can optionally make the program do the following: if the user's IQ is 150 or greater, then iq loss is zero regardless of other inputs.
Special Notice: You are NOT to use the if-else statement....or even the if statement! in this assignment. Think carefully about your inputs and how they can be used.Lastly, if you have any questions about this assignment, be sure to ask your instructor or any of the LEAD PLAs.1You would normally input this value from the user, but in this case we cannot trust Ralph to understand what is wanted and so it is built into the formula. Ralph doesn't understand most words with 7 letters or more.
2No bonus points, Ralph.