Question: Write a program print _ faces.c that creates a face based on user input. You will prompt the user to input some characters. These characters

Write a program print_faces.c that creates a face based on user input.
You will prompt the user to input some characters. These characters correspond to different facial features. These features are:
Character Group Feature
'a'
eyes _
O
'b'
eyes ~
O
'c'
eyes \
O
'd'
eyes /
O
'e'
nose ^
'f'
nose ~
'g'
mouth \_/
'h'
mouth /-\
'i'
mouth o
The user will put in the eye preference, then nose, then mouth.
If the user wants the eyes to be different, they can enter two letters for the eyes, with the first letter corresponding to the first eye, and the second letter being the second eye. This means the user can enter either 3 or 4 letters.
In the autotests you will be given the exact number of characters seen in the input. This means that if you get given afg, scanf("%c%c%c%c") will not work as there are only 3 characters given in the tests. This is to say there will be NO trailing newline character, '
', in the inputs (which is something you get when manually testing when you hit enter, but is not something that happens in the autotests).
Examples
dcc print_faces.c -o print_faces
./print_faces
How do you want to build a face?: afg
__
O O
~
\_/
./print_faces
How do you want to build a face?: ceh
\\
O O
^
/-\
./print_faces
How do you want to build a face?: cdei
\/
O O
^
o
./print_faces
How do you want to build a face?: abeg
_ ~
O O
^
\_/
./print_faces
How do you want to build a face?: dbfi
/ ~
O O
~
o
./print_faces
How do you want to build a face?: bbei
~ ~
O O
^
o
Assumptions/Restrictions/Clarifications
You should only use content taught in the course up to (and including) week 2.
You can assume you will only be given letters between 'a' and 'i' inclusive.
You can assume that the characters are given in the correct order (e.g. eyes then nose then mouth)
You can assume you will only be given 3 or 4 letters, no more, no less.
You can assume you will only get one letter corresponding to the nose, and one letter corresponding to the mouth.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!