Make a flowchart based on this c++ program   #include #include #include #include using namespace std; //A structure that contains passenger's data struct Passenger { string flightNo; string passportNo; string name; int age; string country; double bodyTemperature; string email; }; int StoI(string num) //A function that converts a string to integer { int digit, result = 0; int i; for(i=0; i> passenger[i].flightNo; inFile >> passenger[i].passportNo; inFile >> passenger[i].name; string temp; while(inFile >> temp) { if(temp[0] >= '0' && temp[0] <= '9') { passenger[i].age = StoI(temp); break; } else { passenger[i].name += " " + temp; } } inFile >> passenger[i].country; while(inFile >> temp) { if(temp[0] >= '0' && temp[0] <= '9') { passenger[i].bodyTemperature = StoD(temp); break; } else { passenger[i].country += " " + temp; } } inFile >> passenger[i].email; i++; } int totalPassenger = i; string PassportNo; while(1) { cout << "Enter your Passport Number or enter 0 to exit: "; //Query to passenger cin >> PassportNo; if(PassportNo == "0") //Terminating condition break; j = -1; for(i=0; i 99.5) { cout << "Sorry, you need to hospitalized." << endl; } else { cout << "You can go to home quarantine." << endl; } } cout << endl; } return 0; }

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

Make a flowchart based on this c++ program

 

#include <iostream>
#include <string>
#include <math.h>
#include <fstream>

using namespace std;

//A structure that contains passenger's data
struct Passenger
{
string flightNo;
string passportNo;
string name;
int age;
string country;
double bodyTemperature;
string email;
};

int StoI(string num) //A function that converts a string to integer
{
int digit, result = 0;
int i;

for(i=0; i<num.length(); i++)
{
digit = num[i] - '0';
result = result*10 + digit;
}
return result;
}

double StoD(string num) //A function that converts a string to double
{
int digit;
double result = 0;
int i, j;

for(i=0; i<num.length(); i++)
{
if(num[i] == '.')
{
j = i;
continue;
}
digit = num[i] - '0';
result = result*10 + digit;
}

int dec = num.length()-j-1;

result /= pow(10, dec);

return result;
}

int main()
{
Passenger passenger[10]; //Creating an array of Passenger structure

int i = 0, j;


ifstream inFile; //Read from file
inFile.open("Input.txt");


string title;
getline(inFile, title); //Taking the first line of the input file

while(!inFile.eof()) //Taking Passengers' data from the input file
{
inFile >> passenger[i].flightNo;
inFile >> passenger[i].passportNo;
inFile >> passenger[i].name;

string temp;
while(inFile >> temp)
{
if(temp[0] >= '0' && temp[0] <= '9')
{
passenger[i].age = StoI(temp);
break;
}
else
{
passenger[i].name += " " + temp;
}
}

inFile >> passenger[i].country;

while(inFile >> temp)
{
if(temp[0] >= '0' && temp[0] <= '9')
{
passenger[i].bodyTemperature = StoD(temp);
break;
}
else
{
passenger[i].country += " " + temp;
}
}

inFile >> passenger[i].email;

i++;
}

int totalPassenger = i;

string PassportNo;


while(1)
{
cout << "Enter your Passport Number or enter 0 to exit: "; //Query to passenger
cin >> PassportNo;

if(PassportNo == "0") //Terminating condition
break;

j = -1;

for(i=0; i<totalPassenger; i++) //To search from the passengers' list
{
if(passenger[i].passportNo == PassportNo)
{
j = i; //Storing found index number
break;
}
}

if(i==totalPassenger) //If passenger's Passport Number is not found
cout << "Wrong Passport Number." << endl;
else
{
//Showing passenger's information
cout << "Passenger's Name : " << passenger[j].name << endl;
cout << "Passenger's Passport No. : " << passenger[j].passportNo << endl;
cout << "Passenger's Age : " << passenger[j].age << endl;
cout << "Passenger's Flight No. : " << passenger[j].flightNo << endl;
cout << "Passenger's Country : " << passenger[j].country << endl;
cout << "Passenger's Body Temperature : " << passenger[j].bodyTemperature << endl;

//Showing result
if(passenger[j].bodyTemperature > 99.5)
{
cout << "Sorry, you need to hospitalized." << endl;
}
else
{
cout << "You can go to home quarantine." << endl;
}
}
cout << endl;
}


return 0;
}

 

 

Enter your Pasport Number or enter 0 to exit: MY22222
Passenger's Name
Passenger's Pasport No.
Passenger's Age
Passenger's Flight No.
Passenger's Country
Passenger's Body Temperature : 98.2
You can go to home quarantine.
: Mr. Ali
: MY22222
: 37
: MH3377
: MY
Enter your Pasport Number or enter 0 to exit:
Transcribed Image Text:Enter your Pasport Number or enter 0 to exit: MY22222 Passenger's Name Passenger's Pasport No. Passenger's Age Passenger's Flight No. Passenger's Country Passenger's Body Temperature : 98.2 You can go to home quarantine. : Mr. Ali : MY22222 : 37 : MH3377 : MY Enter your Pasport Number or enter 0 to exit:
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
Algebraic Expressions
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