I've just been to a Dog show and the dogs in there are really talented! One Dog was able to jump over a very high bar and one was able to perform a CPR on a human! Now, I'm inspired to train my Dog too so people will also say that mine is talented! Could you please help me with this?

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)

5. Talented Dogs
by CodeChum Admin

I've just been to a Dog show and the dogs in there are really talented! One Dog was able to jump over a very high bar and one was able to perform a CPR on a human!

Now, I'm inspired to train my Dog too so people will also say that mine is talented! Could you please help me with this?

Instructions:

In the code editor, you are provided with the enum, DogTalent. Then in the main(), the user is asked for an option which represents the talent to be trained. After that, the option selected is checked and the appropriate talent message is printed.
Your task is to fill in the blanks found in lines 20 - 24, with the correct enum values of the DogTalent.
Input

1. Talent selected

Output

Which·talent·do·you·want·to·choose?
d·-·Dance
j·-·Juggle
p·-·Play·Dead
Enter·option:·d
The·dog·now·knows·how·to·dance!

main.e
which represents the talent to be
trained. After that, the option selected
is checked and the appropriate talent
message is printed.
1 #includecstdio.h>
2
3 typedef enum {
DANCE - 'd',
JUGGLE = 'j',
PLAY_DEAD
7} DogTalent;
2. Your task is to fil in the blanks found in
4
lines 20 - 24, with the correct enum
values of the DogTalent.
9 int main(void)
char option;
Input
10
11
1. Talent selected
printf( "Which talent do you want to choose?\n");
printf("d - Dance\n");
printf("j - Juggle\n");
printf("p - Play Dead\n");
printf("Enter option: ");
scanf("%c", &option);
12
13
Output
14
15
16
17
which talent do you want to choose?
18
d- Dance
I/ TODO: Fill in the blanks using the correct enum values
if(option ) {
printf("The dog now knows how to dance!");
} else if(option ) {
printf("The dog now knows how to juggle!");
} else if(option -) {
printf("The dog now knows how to play dead!");
} else {
printf("The dog is hard to train :(");
19
1-- Juggle
P - Play Dead
20
21
Enter option: d
The dog now knows how to dancel
22
23
24
25
26
27
28
29
30
return e;
+
Transcribed Image Text:main.e which represents the talent to be trained. After that, the option selected is checked and the appropriate talent message is printed. 1 #includecstdio.h> 2 3 typedef enum { DANCE - 'd', JUGGLE = 'j', PLAY_DEAD 7} DogTalent; 2. Your task is to fil in the blanks found in 4 lines 20 - 24, with the correct enum values of the DogTalent. 9 int main(void) char option; Input 10 11 1. Talent selected printf( "Which talent do you want to choose?\n"); printf("d - Dance\n"); printf("j - Juggle\n"); printf("p - Play Dead\n"); printf("Enter option: "); scanf("%c", &option); 12 13 Output 14 15 16 17 which talent do you want to choose? 18 d- Dance I/ TODO: Fill in the blanks using the correct enum values if(option ) { printf("The dog now knows how to dance!"); } else if(option ) { printf("The dog now knows how to juggle!"); } else if(option -) { printf("The dog now knows how to play dead!"); } else { printf("The dog is hard to train :("); 19 1-- Juggle P - Play Dead 20 21 Enter option: d The dog now knows how to dancel 22 23 24 25 26 27 28 29 30 return e; +
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Intelligent Machines
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.
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