{ //print the message Sorry, we do not carry that cout<<"Sorry, we do not carry that."<> addIn; } // Write the rest of the program here. return 0; | // End of main()

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's the error?

CENGAGE MINDTAP
Q Search this course
ASHI
Parallel Arrays in C++
Tasks
JumpinJive.cpp
+
>- Terminal
+
{
//set flag foundIt to true if addin found in
30
Enter coffee add-in or XXX to quit
Input
31
:
arrays addIns
Cream
32
foundIt = true;
33
break;
Whiskey
}
}
if (foundIt == true)
{
//print the name and price for a coffee add-in
cout<<"Name: "<<addIns[x]<<" Price: "<<addInPrices[x]
34
XXX
35
36
Output
37
38
Enter coffee add-in or XXX to quit: Cre
39
Name: Cream Price: 2.89
+orderTotal<<endl;
Enter coffee add-in or XXX to quit: Whi
40
}
41
else
Name: Whiskey Price: 3.75
{
//print the message Sorry, we do not carry that
42
Enter coffee add-in or XXX to quit: XXX
43
44
cout<<"Sorry, we do not carry that."<<endl;
}
45
Results e
46
Order Total is $4.64
47
// Get user input again
.89
1.75
48
cout <« "Enter coffee add-in or XXX to quit: ";
cin >> addIn;
}
// Write the rest of the program here.
Expected Output e
49
.89
1.75
Order Total is $4.64
50
51
52
return 0;
53 } // End of main()
Run checks
A Submit 41%
Transcribed Image Text:CENGAGE MINDTAP Q Search this course ASHI Parallel Arrays in C++ Tasks JumpinJive.cpp + >- Terminal + { //set flag foundIt to true if addin found in 30 Enter coffee add-in or XXX to quit Input 31 : arrays addIns Cream 32 foundIt = true; 33 break; Whiskey } } if (foundIt == true) { //print the name and price for a coffee add-in cout<<"Name: "<<addIns[x]<<" Price: "<<addInPrices[x] 34 XXX 35 36 Output 37 38 Enter coffee add-in or XXX to quit: Cre 39 Name: Cream Price: 2.89 +orderTotal<<endl; Enter coffee add-in or XXX to quit: Whi 40 } 41 else Name: Whiskey Price: 3.75 { //print the message Sorry, we do not carry that 42 Enter coffee add-in or XXX to quit: XXX 43 44 cout<<"Sorry, we do not carry that."<<endl; } 45 Results e 46 Order Total is $4.64 47 // Get user input again .89 1.75 48 cout <« "Enter coffee add-in or XXX to quit: "; cin >> addIn; } // Write the rest of the program here. Expected Output e 49 .89 1.75 Order Total is $4.64 50 51 52 return 0; 53 } // End of main() Run checks A Submit 41%
CENGAGE MINDTAP
Q Search this course
ASHI
Parallel Arrays in C++
Tasks
JumpinJive.cpp
>_ Terminal
1 #include <iostream>
Enter coffee add-in or XXX to quit
2 #include <string>
Test Case ● Incomplete
:
3 using namespace std;
Test for invalid flavors
4
5 int main().
6 {
// Declare variables.
Input
7
// Add-in ordered
string addIn;
const int NUM_ITEMS = 5; // Named constant
8.
Caramel
XXX
// Initialized array of add-ins
string addIns[]
"Amaretto", "Whiskey"};
// Initialized array of add-in prices
double addInPrices[] = {.89, .25, .59, 1.50, 1.75};
bool foundIt = false;
10
11
{"Cream", "Cinnamon", "Chocolate",
Output
12
Enter coffee add-in or XXX to quit: Car
13
14
// Flag variable
// Loop control variable
double orderTotal = 2.00; // All orders start with a 2.00
Sorry, we do not carry that.
Enter coffee add-in or XXX to quit: XXX
15
int x;
16
charge
17
Results e
// Get user input
18
Order Total is $2
19
cout << "Enter coffee add-in or XXX to quit: ";
cin >> addIn;
Sorry we do not carry that.
20
Expected Output ®
21
Sorry we do not carry that.
Order Total is $2
//run a while loop till value of addIn is not XXX
while(addIn != "XXX")
{
22
23
24
|lfar laon to abook ell.
Run checks
A Submit 41%
Transcribed Image Text:CENGAGE MINDTAP Q Search this course ASHI Parallel Arrays in C++ Tasks JumpinJive.cpp >_ Terminal 1 #include <iostream> Enter coffee add-in or XXX to quit 2 #include <string> Test Case ● Incomplete : 3 using namespace std; Test for invalid flavors 4 5 int main(). 6 { // Declare variables. Input 7 // Add-in ordered string addIn; const int NUM_ITEMS = 5; // Named constant 8. Caramel XXX // Initialized array of add-ins string addIns[] "Amaretto", "Whiskey"}; // Initialized array of add-in prices double addInPrices[] = {.89, .25, .59, 1.50, 1.75}; bool foundIt = false; 10 11 {"Cream", "Cinnamon", "Chocolate", Output 12 Enter coffee add-in or XXX to quit: Car 13 14 // Flag variable // Loop control variable double orderTotal = 2.00; // All orders start with a 2.00 Sorry, we do not carry that. Enter coffee add-in or XXX to quit: XXX 15 int x; 16 charge 17 Results e // Get user input 18 Order Total is $2 19 cout << "Enter coffee add-in or XXX to quit: "; cin >> addIn; Sorry we do not carry that. 20 Expected Output ® 21 Sorry we do not carry that. Order Total is $2 //run a while loop till value of addIn is not XXX while(addIn != "XXX") { 22 23 24 |lfar laon to abook ell. Run checks A Submit 41%
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
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