Do in C Program 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Do in C Program

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

main.c
> + c
#include<stdio.h>
2
3 typedef enum {
4
1
GOLDEN_RETRIEVER
1,
LABRADOR_RETRIEVER =
%3D
2,
GERMAN_SHEPHERD = 3,
SIBERIAN_HUSKY = 4,
SHIBA_INU = 5,
8
9.
10
11 int main(void) {
12
13
14
15
16
17
18 -
19
20 -
21
22
} DogBreed;
int breed;
printf("Input the breed of the dog: ");
scanf("%d", &breed);
// TODO: Check if the breed is valid or not
if(-----) {
printf("Yup, the breed is valid");
} else {
printf("Invalid breed!");
}
24
return 0;
25 B
>
NNN NNN
Transcribed Image Text:main.c > + c #include<stdio.h> 2 3 typedef enum { 4 1 GOLDEN_RETRIEVER 1, LABRADOR_RETRIEVER = %3D 2, GERMAN_SHEPHERD = 3, SIBERIAN_HUSKY = 4, SHIBA_INU = 5, 8 9. 10 11 int main(void) { 12 13 14 15 16 17 18 - 19 20 - 21 22 } DogBreed; int breed; printf("Input the breed of the dog: "); scanf("%d", &breed); // TODO: Check if the breed is valid or not if(-----) { printf("Yup, the breed is valid"); } else { printf("Invalid breed!"); } 24 return 0; 25 B > NNN NNN
Tests
Executions
CE Run Tests
Expected Output
Input the breed of the dog: 2
Yup, the breed is valid
O Test Case 2
Your Output
No Output
Expected Output
Input the breed of the dag: 9
Invalid breed!
Transcribed Image Text:Tests Executions CE Run Tests Expected Output Input the breed of the dog: 2 Yup, the breed is valid O Test Case 2 Your Output No Output Expected Output Input the breed of the dag: 9 Invalid breed!
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY