View the step-by-step solution to:

I'm creating a program on visual studio c++ If someone could help by coding two loops to the following code Below is my code // Starting Code /*

I'm creating a program on visual studio c++

If someone could help by coding two loops to the following code






Below is my code


// Starting Code

/*

Christine   

CIS170C

July 11, 2018

*/

 

#include <iostream>  

#include <string>

#include <iomanip>    

using namespace std;

 

void addDrink()

{

      // get input

      cout << "nGetting input for the drink..." << endl;

 

      // write the data to the file

      cout << "nWriting the information to the file..." << endl;

 

      // tell the user that the drink has was added to the library

      cout << "nThe drink has been written to the file..." << endl;

 

}

 

/// entry point to the application

int main()

{

      // create menu variable before the loop

      int choice = 0;

      do

      {

 

      // display the menu

             system("cls"); //clear screen

      cout << "Bartender Menun" << endl;

      cout << "1) Add a Drink" << endl;

      cout << "2) Remove a Drink" << endl;

      cout << "3) Display Drinks" << endl;

      cout << "4) Exit" << endl;

 

      // get input

      cout << "nEnter your choice: ";

 

      cin >> choice;

 

      // run correct process based on the user's choice

      switch (choice)

      {

      case 1:

             cout << "nAdding a drink to the library" << endl;

             break;

      case 2:

             cout << "nRemoving a drink from the library" << endl;

             break;

      case 3:

             cout << "nDisplaying all drinks in the library" << endl;

             break;

      case 4:

             cout << "nGoodbye!" << endl;

             break;

      default:

             cout << "nError. Please select from the menu." << endl;

             break;

      }

 

      // pause                 

      cout << endl; // blank

      system("pause");

 

      } while (choice != 4);

 

      return 0;

 

}

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question