how do i turn this C++ code into flowchart?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

how do i turn this C++ code into flowchart?

void read_menu(MENU menu[], MENU roti[], MENU nasi[], MENU mee[], MENU air[], NUMBER &num, bool &quit)
{
  
   ifstream input("menu.txt");
  
   char checking[5];
  
   num.total = 0;
   num.roti = 0;
   num.mee = 0;
   num.nasi = 0;
   num.air = 0;
  
   if(!input)
   {
      
       cout << "System Error : Input_File Malfunction" << endl;
       quit = true;
       system("pause");
   }
   else{
      
       while(input){
          
           input.getline(checking, 5, '|');
          
           if(checking[0] == 'R'){
              
               strcpy(roti[num.roti].code,checking);
               input.getline(roti[num.roti].item, 50, '|');
               input >> roti[num.roti].price;
               input.ignore();
               num.roti++;
               num.total++;
           }
           else if(checking[0] == 'N'){
              
               strcpy(nasi[num.nasi].code, checking);
               input.getline(nasi[num.nasi].item, 50, '|');
               input >> nasi[num.nasi].price;
               input.ignore();
               num.nasi++;
               num.total++;
           }
           else if(checking[0] == 'M'){
              
               strcpy(mee[num.mee].code, checking);
               input.getline(mee[num.mee].item, 50, '|');
               input >> mee[num.mee].price;
               input.ignore();
               num.mee++;
               num.total++;
           }
           else if(checking[0] == 'A'){
              
               strcpy(air[num.air].code, checking);
               input.getline(air[num.air].item, 50, '|');
               input >> air[num.air].price;
               input.ignore();
               num.air++;
               num.total++;
           }
       }
      
       input.close();
   }
  
   ifstream in_file("menu.txt");
  
   for(int n = 0; n < num.total; n++){
      
       in_file.getline(menu[n].code, 5, '|');
       in_file.getline(menu[n].item, 50, '|');
       in_file >> menu[n].price;
       in_file.ignore();
   }
  
   in_file.close();
  
   return;
}

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY