subject

In this lab, you use what you have learned about parallel arrays to complete a partially completed C++ program. The program should: Either print the name and price for a coffee add-in from the Jumpin’ Jive Coffee Shop Or it should print the message Sorry, we do not carry that. Read the problem description carefully before you begin. The file provided for this lab includes the necessary variable declarations and input statements. You need to write the part of the program that searches for the name of the coffee add-in(s) and either prints the name and price of the add-in or prints the error message if the add-in is not found. Comments in the code tell you where to write your statements. Instructions Study the prewritten code to make sure you understand it. Write the code that searches the array for the name of the add-in ordered by the customer. Write the code that prints the name and price of the add-in or the error message, and then write the code that prints the cost of the total order. Execute the program by clicking the "Run Code" button at the bottom of the screen. Use the following data: Cream Caramel Whiskey chocolate Chocolate Cinnamon Vanilla // JumpinJava. cpp - This program looks up and prints the names and prices of coffee orders. // Input: Interactive // Output: Name and price of coffee orders or error message if add-in is not found #include #include using namespace std; int main() { // Declare variables. string addIn; // Add-in ordered const int NUM_ITEMS = 5; // Named constant // Initialized array of add-ins string addIns[] = {"Cream", "Cinnamon", "Chocolate", "Amaretto", "Whiskey"}; // Initialized array of add-in prices double addInPrices[] = {.89, .25, .59, 1.50, 1.75}; bool foundIt = false; // Flag variable int x; // Loop control variable double orderTotal = 2.00; // All orders start with a 2.00 charge // Get user input cout << "Enter coffee add-in or XXX to quit: "; cin >> addIn;

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Step 1: choose your topics review the project milestone reflections you submitted for modules 1 through 4. choose the one major idea or concept from each module that you feel most applies to your life. in addition, choose an important concept from module 5 that applies to your life. step 2: write your guidebook for each module: write a catchy headline that clearly and concisely sums up your chosen idea or concept write a brief explanation that includes a description of the concept, why it is important, and how it can be applied to your life to make a positive impact choose an exciting, powerful, or engaging image that illustrates your concept remember, you are writing one for each module, so you will have a total of five headlines, five descriptions, and five images. step 3: design your guidebook choose a format to present your digital guidebook. there are many 21st century tools available for creating and submitting your work in the online environment. for more information on tools your school uses, contact your instructor or visit the web 2.0 tools area.
Answers: 3
question
Computers and Technology, 23.06.2019 20:50
3.11.3 quiz: comparing and analyzing function typesquestion 4 of 102 pointswhat can you say about the y-values of the two functions f(x) = 3x2-3 andg(x)=2* - 3?
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
question
Computers and Technology, 24.06.2019 22:30
The a great imaginary circle, or reference line, around earth that is equally distant from the two poles and divides earth into the northern and southern hemispheres.
Answers: 1
You know the right answer?
In this lab, you use what you have learned about parallel arrays to complete a partially completed C...
Questions
question
Mathematics, 25.10.2021 14:00
question
Mathematics, 25.10.2021 14:00