The sketch file contains the code from the parts file on page 35 and 36 of your textbook. Modify this program to create a sketch of a face in which a user is given choices for hair type, eye style, mouth style, etc. and the program prints out the face based on the users choices.
Your program should ask the user for at least three choices for each of at least three face parts. A sample run might be:
> sketch Choices of hair style 1) parted 2) curly 3) balding Enter choice: 2 Choices of eye style 1) beady eyed 2) wears glasses 3) wide eyed Enter choice: 3 Choices of mouth style 1) smile 2) frown 3) surprised Enter choice: 1 Your suspect looks like: @@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@ | | | | | (*) (*) | | | _| |_ |_ _| | |______| | | |
> totem how many faces: 2 |||||||///////// | | | | | O O | | | _| |_ |_ _| | -------- | | | |||||||||||||||| | | | | | . . | | | _| |_ |_ _| | |______| | | |Each ``head'' in the totem pole should be random in the sense that there must be at least three parts to a head, and these should be chosen at random. For example, the function below shows one example of random hair.
void Hair() // postcondition: prints random hair Dice d(3); int choice = d.Roll(); if (1 == choice){ cout << " |||||||///////// " << endl; } else if (2 == choice){ cout << " |||||||||||||||| " << endl; } else if (3 == choice){ cout << " |______________| " << endl; } Sides();
Be sure that you use appropriate "Dice" objects, i.e., if there are three different hair styles a three sided die should be used.
You should have at least three different parts to a head (e.g., hair, eyes, nose, mouth) and, for each part, at least three choices.
When your programs for Parts 1 and 2 compile and produce the correct output, create a "README" file (please use all capital letters). Include your name, the date, and an estimate of how long you worked on the assignment in the "README" file. You must also include a list of names of all those people with whom you collaborated on the assignment.
To submit your programs electronically type
submit6 assign3 sketch totem README
You should receive a message telling you that the programs were submitted correctly.