(C PROGRAMMING ONLY) 6. Finding the Impostor by CodeChum Admin There's this Dog game I played where a group of Dogs gather together and complete missions. One of them though is an impostor because it is not a real dog; its breed is not a dog breed. Your task is to find that impostor. To do this, you need to check Instructions: In the code editor, you are provided with the enum, DogBreed. Furthermore, an initial main() code is provided for you where the user is asked for what the breed of the Dog. Then, in lines 18 - 22, a partial code to check if the breed is valid or not is given. Your task is to fill in the correct condition. Make sure to use the values of the enum, DogBreed in checking. Input 1. Dog Breed Output Input·the·breed·of·the·dog:·2 Yup,·the·breed·is·valid
(C
6. Finding the Impostor
by CodeChum Admin
There's this Dog game I played where a group of Dogs gather together and complete missions. One of them though is an impostor because it is not a real dog; its breed is not a dog breed.
Your task is to find that impostor. To do this, you need to check
Instructions:
In the code editor, you are provided with the enum, DogBreed. Furthermore, an initial main() code is provided for you where the user is asked for what the breed of the Dog.
Then, in lines 18 - 22, a partial code to check if the breed is valid or not is given.
Your task is to fill in the correct condition. Make sure to use the values of the enum, DogBreed in checking.
Input
1. Dog Breed
Output
Input·the·breed·of·the·dog:·2
Yup,·the·breed·is·valid
![1. In the code editor, you are provided
main.c
with the enum, Dogüreed. Furthermore,
an initial main() code is provided for
1 #includecstdio.h>
2
3 typedef enum {
GOLDEN_RETRIEVER = 1,
LABRADOR_RETRIEVER = 2,
GERMAN_SHEPHERD = 3,
SIBERIAN_HUSKY = 4,
SHIBA_INU = 5,
9 } DogBreed;
you where the user is asked for what
the breed of the Dog.
2. Then, in lines 18 - 22, a partial code to
check if the breed is valid or not is
given.
3. Your task is to fil in the correct
condition. Make sure to use the values
10
of the enum, DogBreed in checking.
11 int main(void) {
12
int breed;
13
14
15
printf("Input the breed of the dog: ");
scanf("%d", &breed);
Input
1. Dog Breed
16
// TODO: Check if the breed is valid or not
if( ) {
printf("Yup, the breed is valid");
} else {
printf("Invalid breed!");
17
18
Output
19
20
21
Input the breed of the dog: 2
Yup, the breed is valid
22
23
24
return e;
25 }](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F34441c3d-a958-4944-ba52-a2dc386488e0%2F88fd4b22-a4ee-466e-aa2a-292a0f90f367%2F27gfnxn_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)