Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 printfaces.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 or 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, scanfcccc will not work as there are only 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 printfaces.c o printfaces
printfaces
How do you want to build a face?: afg
O O
~
printfaces
How do you want to build a face?: ceh
O O
printfaces
How do you want to build a face?: cdei
O O
o
printfaces
How do you want to build a face?: abeg
~
O O
printfaces
How do you want to build a face?: dbfi
~
O O
~
o
printfaces
How do you want to build a face?: bbei
~ ~
O O
o
AssumptionsRestrictionsClarifications
You should only use content taught in the course up to and including week
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 eg eyes then nose then mouth
You can assume you will only be given or 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started