(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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

(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 

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 }
Transcribed Image Text: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 }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Literals
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education