9 #include #include double area (double r); 12 using namespace std; 10 11 13 int main() 15 - { 14 double number; string instrname, studnamef, studnamel, rotfood, number, adjective, color, animal; 16 17 18 cout<< "Please input the following information: \n"; cout<< "First or last name of instructor: "; cin>> instrname; 19 20 21 22 cout<< "Your Name (first press enter and the last name): cin>> studnamef >> studnamel; 23 24 25 cout<< "A food: "; cin>> rotfood; 26 27 28 29 cout<< "A number: 30 cin>> number; 31 cout<< "An adjective: cin>> adjective; 32 33 34 cout<< "A color: "; cin>> color; 35 36 37 cout<< "An animal: "; cin>> animal; 38 39 40 <

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

What is wrong with the following code? When ran, the code is supposed to generate a mad-lib for the user to fill in. However, when ran, the program encounters an error.

the language used is C++

istrname is instructor name and studnamef and studnamel are the first and last name of a student repesectfullly. and rotfood is a rotten food. The output for the mad lib is completely up to the user.

****/
*******
#include <iostream>
9
#include <string>
double area (double r);
12 using namespace std;
13
10
11
int main()
15 - {
14
16
double number;
17
string instrname, studnamef, studnamel, rotfood, number, adjective, color, animal;
18
cout<< "Please input the following information: \n";
cout<< "First or last name of instructor: ";
cin>> instrname;
19
20
21
22
cout<< "Your Name (first press enter and the last name):
cin>> studnamef >> studnamel;
23
24
25
cout<< "A food: ";
cin>> rotfood;
26
27
28
cout<< "A number: ";
cin>> number;
29
30
31
cout<< "An adjective:
cin>> adjective;
32
33
34
cout<< "A color: ";
cin>> color;
35
36
37
cout<< "An animal: ";
cin>> animal;
38
39
40
41
cout<<"\n Dear instructor
<<instrname<< "\n \n";
cout<<"I am sorry that I am unable to turn in my ENGR-2010 homework at this time \n";
<<rotfood<< "which made me turn" <<color<< "and \n";
42
43
cout<<"First I ate a rotten
<<number<<
°F. \n";
cout<<"Extremely ill. I came down with a fever of
cout<<"Next, my
cout<<"of the
cout<<"redoing my homework. Please accept it even though it is late. \n \n";
cout<<"Apologetically, \n" <<studnamef<<
44
<<adjective<< "pet" <<animal« "must have smelled the remains \n";
<<rotfood<< "on my homework, because he ate it. I am currently \n";
45
46
47
48
" " <<studnamel<<
Transcribed Image Text:****/ ******* #include <iostream> 9 #include <string> double area (double r); 12 using namespace std; 13 10 11 int main() 15 - { 14 16 double number; 17 string instrname, studnamef, studnamel, rotfood, number, adjective, color, animal; 18 cout<< "Please input the following information: \n"; cout<< "First or last name of instructor: "; cin>> instrname; 19 20 21 22 cout<< "Your Name (first press enter and the last name): cin>> studnamef >> studnamel; 23 24 25 cout<< "A food: "; cin>> rotfood; 26 27 28 cout<< "A number: "; cin>> number; 29 30 31 cout<< "An adjective: cin>> adjective; 32 33 34 cout<< "A color: "; cin>> color; 35 36 37 cout<< "An animal: "; cin>> animal; 38 39 40 41 cout<<"\n Dear instructor <<instrname<< "\n \n"; cout<<"I am sorry that I am unable to turn in my ENGR-2010 homework at this time \n"; <<rotfood<< "which made me turn" <<color<< "and \n"; 42 43 cout<<"First I ate a rotten <<number<< °F. \n"; cout<<"Extremely ill. I came down with a fever of cout<<"Next, my cout<<"of the cout<<"redoing my homework. Please accept it even though it is late. \n \n"; cout<<"Apologetically, \n" <<studnamef<< 44 <<adjective<< "pet" <<animal« "must have smelled the remains \n"; <<rotfood<< "on my homework, because he ate it. I am currently \n"; 45 46 47 48 " " <<studnamel<<
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Loop
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