SlideShare a Scribd company logo
#include
#include
#include
#include
using namespace std;
// Define a Person class, including age, gender, and yearlyIncome.
class Person {
public:
Person();
void Print();
void SetData(int a); // FIXME Also set gender and yearly income
void SetGender(string gender);
void SetIncome(int income);
int GetAge();
string GetGender();
int GetIncome();
private:
int age;
string gender;
int yearlyIncome;
};
// Constructor for the Person class.
Person::Person() {
age = 0;
gender = "default";
yearlyIncome = 0;
return;
}
// Print the Person class.
void Person::Print() {
cout << "Age = " << this->age
<< ", gender = " << this->gender
<< ", yearly income = " << this->yearlyIncome
<< endl;
return;
}
// Set the age, gender, and yearlyIncome of a Person.
void Person::SetData(int a) { // FIXME Also set gender and yearly income
this->age = a;
return;
}
void Person::SetGender(string gender){
this->gender = gender;
}
void Person::SetIncome(int income){
this->yearlyIncome = income;
}
// Get the age of a Person.
int Person::GetAge() {
return this->age;
}
string Person::GetGender(){
return this->gender;
}
int Person::GetIncome() {
return this->yearlyIncome;
}
// Get a filename from program arguments, then make a Person for each line in the file.
bool ReadPeopleFromFile(int argc, char* argv[], vector &people) {
Person tmpPrsn;
ifstream inFS;
int tmpAge = 0;
string tmpGender = "";
int tmpYI = 0;
if (argc != 2) {
cout << " Usage: [EXECUTABLE FILE] [TEXT DATA FILE], e.g. myprog.exe
dev_people.txt" << endl;
return true; // indicates error
}
cout << "Opening file " << argv[1] << ". ";
inFS.open(argv[1]); // Try to open file
if (!inFS.is_open()) {
cout << "Could not open file " << argv[1] << ". ";
return true; // indicates error
}
while (!inFS.eof()) {
inFS >> tmpAge;
inFS >> tmpGender;
inFS >> tmpYI;
tmpPrsn.SetData(tmpAge); // FIXME Also set gender and yearly income
tmpPrsn.SetGender(tmpGender);
tmpPrsn.SetIncome(tmpYI);
tmpPrsn.Print();
people.push_back(tmpPrsn);
}
inFS.close();
cout << "Finished reading file." << endl;
return false; // indicates no error
}
// Ask user to enter age range.
void GetUserInput(int &ageLowerRange, int &ageUpperRange, string &gender, int
&yILowerIncome,int &yIHigherIncome) {
cout<<" Enter lower range of age: ";
cin >> ageLowerRange;
cout << "Enter upper range of age: ";
cin >> ageUpperRange;
cout << "Enter the gender: ";
cin >> gender;
cout << "Enter the lower range of yearlyIncome: ";
cin >> yILowerIncome;
cout << "Enter the higher range of yearlyIncome: ";
cin >> yIHigherIncome;
return;
}
// Return people within the given age range.
vector GetPeopleInAgeRange(vector ppl, int lowerRange, int upperRange) {
unsigned int i = 0;
vector pplInAgeRange;
int age = 0;
for (i = 0; i < ppl.size(); ++i) {
age = ppl.at(i).GetAge();
if ((age >= lowerRange) && (age <= upperRange)) {
pplInAgeRange.push_back(ppl.at(i));
}
}
return pplInAgeRange;
}
// Return people with same Gender.
vector GetPeopleWithSpecificGender(vector ptntlCstmrs,string gender){
vector pplWithSameGender;
string gndr;
for (int i=0;i GetPeopleInIncomeRange(vector ptntlCstmrs,int lowerRange, int higherRange){
vector pplInIncomeRange;
int range = 0;
for (int i=0;i= lowerRange) && (range <= higherRange)){
pplInIncomeRange.push_back(ptntlCstmrs.at(i));
}
}
return pplInIncomeRange;
}
int main(int argc, char* argv[]) {
vector ptntlCstmrs;
bool hadError = false;
int ageLowerRange = 0;
int ageUpperRange = 0;
string gender;
int yILowerIncome = 0;
int yIHigherIncome = 0;
hadError = ReadPeopleFromFile(argc, argv, ptntlCstmrs);
if( hadError ) {
return 1; // indicates error
}
GetUserInput(ageLowerRange, ageUpperRange, gender, yILowerIncome, yIHigherIncome );
ptntlCstmrs = GetPeopleInAgeRange(ptntlCstmrs, ageLowerRange, ageUpperRange);
ptntlCstmrs = GetPeopleWithSpecificGender(ptntlCstmrs,gender);
ptntlCstmrs = GetPeopleInIncomeRange(ptntlCstmrs,yILowerIncome,yIHigherIncome);
cout << " Number of potential customers = "<
Solution
HI Friend, I have separated code in seperate files.
Please let me know in case of any issue.
############# Person.h ##########
#include
using namespace std;
class Person {
public:
Person();
void Print();
void SetData(int a); // FIXME Also set gender and yearly income
void SetGender(string gender);
void SetIncome(int income);
int GetAge();
string GetGender();
int GetIncome();
private:
int age;
string gender;
int yearlyIncome;
};
############## Person.cpp #############
#include
#include "Person.h"
using namespace std;
// Constructor for the Person class.
Person::Person() {
age = 0;
gender = "default";
yearlyIncome = 0;
return;
}
// Print the Person class.
void Person::Print() {
cout << "Age = " << this->age
<< ", gender = " << this->gender
<< ", yearly income = " << this->yearlyIncome
<< endl;
return;
}
// Set the age, gender, and yearlyIncome of a Person.
void Person::SetData(int a) { // FIXME Also set gender and yearly income
this->age = a;
return;
}
void Person::SetGender(string gender){
this->gender = gender;
}
void Person::SetIncome(int income){
this->yearlyIncome = income;
}
// Get the age of a Person.
int Person::GetAge() {
return this->age;
}
string Person::GetGender(){
return this->gender;
}
int Person::GetIncome() {
return this->yearlyIncome;
}
############## PersonTest.cpp ###########
#include
#include
#include
#include
#include "Person.h"
using namespace std;
// Get a filename from program arguments, then make a Person for each line in the file.
bool ReadPeopleFromFile(int argc, char* argv[], vector &people) {
Person tmpPrsn;
ifstream inFS;
int tmpAge = 0;
string tmpGender = "";
int tmpYI = 0;
if (argc != 2) {
cout << " Usage: [EXECUTABLE FILE] [TEXT DATA FILE], e.g. myprog.exe
dev_people.txt" << endl;
return true; // indicates error
}
cout << "Opening file " << argv[1] << ". ";
inFS.open(argv[1]); // Try to open file
if (!inFS.is_open()) {
cout << "Could not open file " << argv[1] << ". ";
return true; // indicates error
}
while (!inFS.eof()) {
inFS >> tmpAge;
inFS >> tmpGender;
inFS >> tmpYI;
tmpPrsn.SetData(tmpAge); // FIXME Also set gender and yearly income
tmpPrsn.SetGender(tmpGender);
tmpPrsn.SetIncome(tmpYI);
tmpPrsn.Print();
people.push_back(tmpPrsn);
}
inFS.close();
cout << "Finished reading file." << endl;
return false; // indicates no error
}
// Ask user to enter age range.
void GetUserInput(int &ageLowerRange, int &ageUpperRange, string &gender, int
&yILowerIncome,int &yIHigherIncome) {
cout<<" Enter lower range of age: ";
cin >> ageLowerRange;
cout << "Enter upper range of age: ";
cin >> ageUpperRange;
cout << "Enter the gender: ";
cin >> gender;
cout << "Enter the lower range of yearlyIncome: ";
cin >> yILowerIncome;
cout << "Enter the higher range of yearlyIncome: ";
cin >> yIHigherIncome;
return;
}
// Return people within the given age range.
vector GetPeopleInAgeRange(vector ppl, int lowerRange, int upperRange) {
unsigned int i = 0;
vector pplInAgeRange;
int age = 0;
for (i = 0; i < ppl.size(); ++i) {
age = ppl.at(i).GetAge();
if ((age >= lowerRange) && (age <= upperRange)) {
pplInAgeRange.push_back(ppl.at(i));
}
}
return pplInAgeRange;
}
// Return people with same Gender.
vector GetPeopleWithSpecificGender(vector ptntlCstmrs,string gender){
vector pplWithSameGender;
string gndr;
for (int i=0;i GetPeopleInIncomeRange(vector ptntlCstmrs,int lowerRange, int higherRange){
vector pplInIncomeRange;
int range = 0;
for (int i=0;i= lowerRange) && (range <= higherRange)){
pplInIncomeRange.push_back(ptntlCstmrs.at(i));
}
}
return pplInIncomeRange;
}
int main(int argc, char* argv[]) {
vector ptntlCstmrs;
bool hadError = false;
int ageLowerRange = 0;
int ageUpperRange = 0;
string gender;
int yILowerIncome = 0;
int yIHigherIncome = 0;
hadError = ReadPeopleFromFile(argc, argv, ptntlCstmrs);
if( hadError ) {
return 1; // indicates error
}
GetUserInput(ageLowerRange, ageUpperRange, gender, yILowerIncome, yIHigherIncome );
ptntlCstmrs = GetPeopleInAgeRange(ptntlCstmrs, ageLowerRange, ageUpperRange);
ptntlCstmrs = GetPeopleWithSpecificGender(ptntlCstmrs,gender);
ptntlCstmrs = GetPeopleInIncomeRange(ptntlCstmrs,yILowerIncome,yIHigherIncome);
cout << " Number of potential customers = "<

More Related Content

Similar to #include iostream #include fstream #include vector #incl.pdf

Program.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdfProgram.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdf
anandshingavi23
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdf
anitasahani11
 
Program: Inheritance in Class - to find topper out of 10 students
Program: Inheritance in Class - to find topper out of 10 studentsProgram: Inheritance in Class - to find topper out of 10 students
Program: Inheritance in Class - to find topper out of 10 students
Swarup Boro
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
rajkumarm401
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
aplolomedicalstoremr
 
Tu1
Tu1Tu1
9.C Programming
9.C Programming9.C Programming
9.C Programming
Export Promotion Bureau
 
PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
 PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
annamalaiagencies
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
normanibarber20063
 
Najmul
Najmul  Najmul
Najmul
Najmul Ashik
 
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docxproject4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
wkyra78
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
allystraders
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
mhande899
 
This code has nine errors- but I don't know how to solve it- Please g.pdf
This code has nine errors- but I don't know how to solve it-  Please g.pdfThis code has nine errors- but I don't know how to solve it-  Please g.pdf
This code has nine errors- but I don't know how to solve it- Please g.pdf
aamousnowov
 
C++ 5-6-2 Basic derived class member override Define a member function.docx
C++ 5-6-2 Basic derived class member override Define a member function.docxC++ 5-6-2 Basic derived class member override Define a member function.docx
C++ 5-6-2 Basic derived class member override Define a member function.docx
RichardjOZTerryp
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf
annucommunication1
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdf
ankitmobileshop235
 
package employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdfpackage employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdf
anwarsadath111
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
Saranya saran
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
arihantgiftgallery
 

Similar to #include iostream #include fstream #include vector #incl.pdf (20)

Program.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdfProgram.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdf
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdf
 
Program: Inheritance in Class - to find topper out of 10 students
Program: Inheritance in Class - to find topper out of 10 studentsProgram: Inheritance in Class - to find topper out of 10 students
Program: Inheritance in Class - to find topper out of 10 students
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
 
Tu1
Tu1Tu1
Tu1
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
 PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
PersonData.h#ifndef PersonData_h #define PersonData_h#inclu.pdf
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
 
Najmul
Najmul  Najmul
Najmul
 
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docxproject4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
project4-ast.DS_Storeproject4-astast.c#include symbolTa.docx
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
 
This code has nine errors- but I don't know how to solve it- Please g.pdf
This code has nine errors- but I don't know how to solve it-  Please g.pdfThis code has nine errors- but I don't know how to solve it-  Please g.pdf
This code has nine errors- but I don't know how to solve it- Please g.pdf
 
C++ 5-6-2 Basic derived class member override Define a member function.docx
C++ 5-6-2 Basic derived class member override Define a member function.docxC++ 5-6-2 Basic derived class member override Define a member function.docx
C++ 5-6-2 Basic derived class member override Define a member function.docx
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdf
 
package employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdfpackage employeeType.employee;public class Employee {   private .pdf
package employeeType.employee;public class Employee {   private .pdf
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 
So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 

More from shahidqamar17

At one time, the country of Aquilonia had no banks, but had curre.pdf
At one time, the country of Aquilonia had no banks, but had curre.pdfAt one time, the country of Aquilonia had no banks, but had curre.pdf
At one time, the country of Aquilonia had no banks, but had curre.pdf
shahidqamar17
 
A certain element has a half life of 4.5 billion years. a. You find .pdf
A certain element has a half life of 4.5 billion years. a. You find .pdfA certain element has a half life of 4.5 billion years. a. You find .pdf
A certain element has a half life of 4.5 billion years. a. You find .pdf
shahidqamar17
 
A linear system is always time-invariant.SolutionNo its false. .pdf
A linear system is always time-invariant.SolutionNo its false. .pdfA linear system is always time-invariant.SolutionNo its false. .pdf
A linear system is always time-invariant.SolutionNo its false. .pdf
shahidqamar17
 
Workforce Management also called Human Resource Management manages o.pdf
Workforce Management also called Human Resource Management manages o.pdfWorkforce Management also called Human Resource Management manages o.pdf
Workforce Management also called Human Resource Management manages o.pdf
shahidqamar17
 
Where has healthcare information management been historically How h.pdf
Where has healthcare information management been historically How h.pdfWhere has healthcare information management been historically How h.pdf
Where has healthcare information management been historically How h.pdf
shahidqamar17
 
What were the successes and failures of the Progressive Movement, an.pdf
What were the successes and failures of the Progressive Movement, an.pdfWhat were the successes and failures of the Progressive Movement, an.pdf
What were the successes and failures of the Progressive Movement, an.pdf
shahidqamar17
 
What is the difference between private sector, nonprofit sector, and.pdf
What is the difference between private sector, nonprofit sector, and.pdfWhat is the difference between private sector, nonprofit sector, and.pdf
What is the difference between private sector, nonprofit sector, and.pdf
shahidqamar17
 
What are Cubas entrepreneurial opportunities and the status of .pdf
What are Cubas entrepreneurial opportunities and the status of .pdfWhat are Cubas entrepreneurial opportunities and the status of .pdf
What are Cubas entrepreneurial opportunities and the status of .pdf
shahidqamar17
 
The LabVIEW G programming is considered to be a data flow programmin.pdf
The LabVIEW G programming is considered to be a data flow programmin.pdfThe LabVIEW G programming is considered to be a data flow programmin.pdf
The LabVIEW G programming is considered to be a data flow programmin.pdf
shahidqamar17
 
what is a bottom heap up construction with an example pleaseSol.pdf
what is a bottom heap up construction with an example pleaseSol.pdfwhat is a bottom heap up construction with an example pleaseSol.pdf
what is a bottom heap up construction with an example pleaseSol.pdf
shahidqamar17
 
What are the types of differences that exist between IFRS and U.S. G.pdf
What are the types of differences that exist between IFRS and U.S. G.pdfWhat are the types of differences that exist between IFRS and U.S. G.pdf
What are the types of differences that exist between IFRS and U.S. G.pdf
shahidqamar17
 
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdfROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
shahidqamar17
 
question.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdfquestion.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdf
shahidqamar17
 
Question 25 A Multilateral agreement in which countries signed to ban.pdf
Question 25 A Multilateral agreement in which countries signed to ban.pdfQuestion 25 A Multilateral agreement in which countries signed to ban.pdf
Question 25 A Multilateral agreement in which countries signed to ban.pdf
shahidqamar17
 
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdfProve. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
shahidqamar17
 
1Write a Java program that calculates and displays the Fibonacciseri.pdf
1Write a Java program that calculates and displays the Fibonacciseri.pdf1Write a Java program that calculates and displays the Fibonacciseri.pdf
1Write a Java program that calculates and displays the Fibonacciseri.pdf
shahidqamar17
 
need an example of a System Anaysis and design project must have 3 .pdf
need an example of a System Anaysis and design project must have 3 .pdfneed an example of a System Anaysis and design project must have 3 .pdf
need an example of a System Anaysis and design project must have 3 .pdf
shahidqamar17
 
Money laundering has become a mechanism for terrorist financing acti.pdf
Money laundering has become a mechanism for terrorist financing acti.pdfMoney laundering has become a mechanism for terrorist financing acti.pdf
Money laundering has become a mechanism for terrorist financing acti.pdf
shahidqamar17
 
Let x be any set and let lambda SolutionProof. Obviously .pdf
Let x be any set and let lambda SolutionProof. Obviously .pdfLet x be any set and let lambda SolutionProof. Obviously .pdf
Let x be any set and let lambda SolutionProof. Obviously .pdf
shahidqamar17
 
Java public cts Node t next ni next SolutionYou hav.pdf
Java public cts Node t next ni next SolutionYou hav.pdfJava public cts Node t next ni next SolutionYou hav.pdf
Java public cts Node t next ni next SolutionYou hav.pdf
shahidqamar17
 

More from shahidqamar17 (20)

At one time, the country of Aquilonia had no banks, but had curre.pdf
At one time, the country of Aquilonia had no banks, but had curre.pdfAt one time, the country of Aquilonia had no banks, but had curre.pdf
At one time, the country of Aquilonia had no banks, but had curre.pdf
 
A certain element has a half life of 4.5 billion years. a. You find .pdf
A certain element has a half life of 4.5 billion years. a. You find .pdfA certain element has a half life of 4.5 billion years. a. You find .pdf
A certain element has a half life of 4.5 billion years. a. You find .pdf
 
A linear system is always time-invariant.SolutionNo its false. .pdf
A linear system is always time-invariant.SolutionNo its false. .pdfA linear system is always time-invariant.SolutionNo its false. .pdf
A linear system is always time-invariant.SolutionNo its false. .pdf
 
Workforce Management also called Human Resource Management manages o.pdf
Workforce Management also called Human Resource Management manages o.pdfWorkforce Management also called Human Resource Management manages o.pdf
Workforce Management also called Human Resource Management manages o.pdf
 
Where has healthcare information management been historically How h.pdf
Where has healthcare information management been historically How h.pdfWhere has healthcare information management been historically How h.pdf
Where has healthcare information management been historically How h.pdf
 
What were the successes and failures of the Progressive Movement, an.pdf
What were the successes and failures of the Progressive Movement, an.pdfWhat were the successes and failures of the Progressive Movement, an.pdf
What were the successes and failures of the Progressive Movement, an.pdf
 
What is the difference between private sector, nonprofit sector, and.pdf
What is the difference between private sector, nonprofit sector, and.pdfWhat is the difference between private sector, nonprofit sector, and.pdf
What is the difference between private sector, nonprofit sector, and.pdf
 
What are Cubas entrepreneurial opportunities and the status of .pdf
What are Cubas entrepreneurial opportunities and the status of .pdfWhat are Cubas entrepreneurial opportunities and the status of .pdf
What are Cubas entrepreneurial opportunities and the status of .pdf
 
The LabVIEW G programming is considered to be a data flow programmin.pdf
The LabVIEW G programming is considered to be a data flow programmin.pdfThe LabVIEW G programming is considered to be a data flow programmin.pdf
The LabVIEW G programming is considered to be a data flow programmin.pdf
 
what is a bottom heap up construction with an example pleaseSol.pdf
what is a bottom heap up construction with an example pleaseSol.pdfwhat is a bottom heap up construction with an example pleaseSol.pdf
what is a bottom heap up construction with an example pleaseSol.pdf
 
What are the types of differences that exist between IFRS and U.S. G.pdf
What are the types of differences that exist between IFRS and U.S. G.pdfWhat are the types of differences that exist between IFRS and U.S. G.pdf
What are the types of differences that exist between IFRS and U.S. G.pdf
 
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdfROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
ROT13 (rotate by 13 places) is a simple letter substitution cipher t.pdf
 
question.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdfquestion.(player, entity ,field and base.java codes are given)Stop.pdf
question.(player, entity ,field and base.java codes are given)Stop.pdf
 
Question 25 A Multilateral agreement in which countries signed to ban.pdf
Question 25 A Multilateral agreement in which countries signed to ban.pdfQuestion 25 A Multilateral agreement in which countries signed to ban.pdf
Question 25 A Multilateral agreement in which countries signed to ban.pdf
 
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdfProve. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
Prove. Let n be a natural number. Any set of n integers {a1, a2, . ..pdf
 
1Write a Java program that calculates and displays the Fibonacciseri.pdf
1Write a Java program that calculates and displays the Fibonacciseri.pdf1Write a Java program that calculates and displays the Fibonacciseri.pdf
1Write a Java program that calculates and displays the Fibonacciseri.pdf
 
need an example of a System Anaysis and design project must have 3 .pdf
need an example of a System Anaysis and design project must have 3 .pdfneed an example of a System Anaysis and design project must have 3 .pdf
need an example of a System Anaysis and design project must have 3 .pdf
 
Money laundering has become a mechanism for terrorist financing acti.pdf
Money laundering has become a mechanism for terrorist financing acti.pdfMoney laundering has become a mechanism for terrorist financing acti.pdf
Money laundering has become a mechanism for terrorist financing acti.pdf
 
Let x be any set and let lambda SolutionProof. Obviously .pdf
Let x be any set and let lambda SolutionProof. Obviously .pdfLet x be any set and let lambda SolutionProof. Obviously .pdf
Let x be any set and let lambda SolutionProof. Obviously .pdf
 
Java public cts Node t next ni next SolutionYou hav.pdf
Java public cts Node t next ni next SolutionYou hav.pdfJava public cts Node t next ni next SolutionYou hav.pdf
Java public cts Node t next ni next SolutionYou hav.pdf
 

Recently uploaded

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 

#include iostream #include fstream #include vector #incl.pdf

  • 1. #include #include #include #include using namespace std; // Define a Person class, including age, gender, and yearlyIncome. class Person { public: Person(); void Print(); void SetData(int a); // FIXME Also set gender and yearly income void SetGender(string gender); void SetIncome(int income); int GetAge(); string GetGender(); int GetIncome(); private: int age; string gender; int yearlyIncome; }; // Constructor for the Person class. Person::Person() { age = 0; gender = "default"; yearlyIncome = 0; return; } // Print the Person class. void Person::Print() { cout << "Age = " << this->age << ", gender = " << this->gender << ", yearly income = " << this->yearlyIncome << endl; return;
  • 2. } // Set the age, gender, and yearlyIncome of a Person. void Person::SetData(int a) { // FIXME Also set gender and yearly income this->age = a; return; } void Person::SetGender(string gender){ this->gender = gender; } void Person::SetIncome(int income){ this->yearlyIncome = income; } // Get the age of a Person. int Person::GetAge() { return this->age; } string Person::GetGender(){ return this->gender; } int Person::GetIncome() { return this->yearlyIncome; } // Get a filename from program arguments, then make a Person for each line in the file. bool ReadPeopleFromFile(int argc, char* argv[], vector &people) { Person tmpPrsn; ifstream inFS; int tmpAge = 0; string tmpGender = ""; int tmpYI = 0; if (argc != 2) { cout << " Usage: [EXECUTABLE FILE] [TEXT DATA FILE], e.g. myprog.exe dev_people.txt" << endl; return true; // indicates error } cout << "Opening file " << argv[1] << ". "; inFS.open(argv[1]); // Try to open file
  • 3. if (!inFS.is_open()) { cout << "Could not open file " << argv[1] << ". "; return true; // indicates error } while (!inFS.eof()) { inFS >> tmpAge; inFS >> tmpGender; inFS >> tmpYI; tmpPrsn.SetData(tmpAge); // FIXME Also set gender and yearly income tmpPrsn.SetGender(tmpGender); tmpPrsn.SetIncome(tmpYI); tmpPrsn.Print(); people.push_back(tmpPrsn); } inFS.close(); cout << "Finished reading file." << endl; return false; // indicates no error } // Ask user to enter age range. void GetUserInput(int &ageLowerRange, int &ageUpperRange, string &gender, int &yILowerIncome,int &yIHigherIncome) { cout<<" Enter lower range of age: "; cin >> ageLowerRange; cout << "Enter upper range of age: "; cin >> ageUpperRange; cout << "Enter the gender: "; cin >> gender; cout << "Enter the lower range of yearlyIncome: "; cin >> yILowerIncome; cout << "Enter the higher range of yearlyIncome: "; cin >> yIHigherIncome; return; } // Return people within the given age range. vector GetPeopleInAgeRange(vector ppl, int lowerRange, int upperRange) { unsigned int i = 0;
  • 4. vector pplInAgeRange; int age = 0; for (i = 0; i < ppl.size(); ++i) { age = ppl.at(i).GetAge(); if ((age >= lowerRange) && (age <= upperRange)) { pplInAgeRange.push_back(ppl.at(i)); } } return pplInAgeRange; } // Return people with same Gender. vector GetPeopleWithSpecificGender(vector ptntlCstmrs,string gender){ vector pplWithSameGender; string gndr; for (int i=0;i GetPeopleInIncomeRange(vector ptntlCstmrs,int lowerRange, int higherRange){ vector pplInIncomeRange; int range = 0; for (int i=0;i= lowerRange) && (range <= higherRange)){ pplInIncomeRange.push_back(ptntlCstmrs.at(i)); } } return pplInIncomeRange; } int main(int argc, char* argv[]) { vector ptntlCstmrs; bool hadError = false; int ageLowerRange = 0; int ageUpperRange = 0; string gender; int yILowerIncome = 0; int yIHigherIncome = 0; hadError = ReadPeopleFromFile(argc, argv, ptntlCstmrs); if( hadError ) { return 1; // indicates error } GetUserInput(ageLowerRange, ageUpperRange, gender, yILowerIncome, yIHigherIncome );
  • 5. ptntlCstmrs = GetPeopleInAgeRange(ptntlCstmrs, ageLowerRange, ageUpperRange); ptntlCstmrs = GetPeopleWithSpecificGender(ptntlCstmrs,gender); ptntlCstmrs = GetPeopleInIncomeRange(ptntlCstmrs,yILowerIncome,yIHigherIncome); cout << " Number of potential customers = "< Solution HI Friend, I have separated code in seperate files. Please let me know in case of any issue. ############# Person.h ########## #include using namespace std; class Person { public: Person(); void Print(); void SetData(int a); // FIXME Also set gender and yearly income void SetGender(string gender); void SetIncome(int income); int GetAge(); string GetGender(); int GetIncome(); private: int age; string gender; int yearlyIncome; }; ############## Person.cpp ############# #include #include "Person.h" using namespace std; // Constructor for the Person class. Person::Person() { age = 0; gender = "default"; yearlyIncome = 0;
  • 6. return; } // Print the Person class. void Person::Print() { cout << "Age = " << this->age << ", gender = " << this->gender << ", yearly income = " << this->yearlyIncome << endl; return; } // Set the age, gender, and yearlyIncome of a Person. void Person::SetData(int a) { // FIXME Also set gender and yearly income this->age = a; return; } void Person::SetGender(string gender){ this->gender = gender; } void Person::SetIncome(int income){ this->yearlyIncome = income; } // Get the age of a Person. int Person::GetAge() { return this->age; } string Person::GetGender(){ return this->gender; } int Person::GetIncome() { return this->yearlyIncome; } ############## PersonTest.cpp ########### #include #include #include #include
  • 7. #include "Person.h" using namespace std; // Get a filename from program arguments, then make a Person for each line in the file. bool ReadPeopleFromFile(int argc, char* argv[], vector &people) { Person tmpPrsn; ifstream inFS; int tmpAge = 0; string tmpGender = ""; int tmpYI = 0; if (argc != 2) { cout << " Usage: [EXECUTABLE FILE] [TEXT DATA FILE], e.g. myprog.exe dev_people.txt" << endl; return true; // indicates error } cout << "Opening file " << argv[1] << ". "; inFS.open(argv[1]); // Try to open file if (!inFS.is_open()) { cout << "Could not open file " << argv[1] << ". "; return true; // indicates error } while (!inFS.eof()) { inFS >> tmpAge; inFS >> tmpGender; inFS >> tmpYI; tmpPrsn.SetData(tmpAge); // FIXME Also set gender and yearly income tmpPrsn.SetGender(tmpGender); tmpPrsn.SetIncome(tmpYI); tmpPrsn.Print(); people.push_back(tmpPrsn); } inFS.close(); cout << "Finished reading file." << endl; return false; // indicates no error } // Ask user to enter age range. void GetUserInput(int &ageLowerRange, int &ageUpperRange, string &gender, int
  • 8. &yILowerIncome,int &yIHigherIncome) { cout<<" Enter lower range of age: "; cin >> ageLowerRange; cout << "Enter upper range of age: "; cin >> ageUpperRange; cout << "Enter the gender: "; cin >> gender; cout << "Enter the lower range of yearlyIncome: "; cin >> yILowerIncome; cout << "Enter the higher range of yearlyIncome: "; cin >> yIHigherIncome; return; } // Return people within the given age range. vector GetPeopleInAgeRange(vector ppl, int lowerRange, int upperRange) { unsigned int i = 0; vector pplInAgeRange; int age = 0; for (i = 0; i < ppl.size(); ++i) { age = ppl.at(i).GetAge(); if ((age >= lowerRange) && (age <= upperRange)) { pplInAgeRange.push_back(ppl.at(i)); } } return pplInAgeRange; } // Return people with same Gender. vector GetPeopleWithSpecificGender(vector ptntlCstmrs,string gender){ vector pplWithSameGender; string gndr; for (int i=0;i GetPeopleInIncomeRange(vector ptntlCstmrs,int lowerRange, int higherRange){ vector pplInIncomeRange; int range = 0; for (int i=0;i= lowerRange) && (range <= higherRange)){ pplInIncomeRange.push_back(ptntlCstmrs.at(i)); }
  • 9. } return pplInIncomeRange; } int main(int argc, char* argv[]) { vector ptntlCstmrs; bool hadError = false; int ageLowerRange = 0; int ageUpperRange = 0; string gender; int yILowerIncome = 0; int yIHigherIncome = 0; hadError = ReadPeopleFromFile(argc, argv, ptntlCstmrs); if( hadError ) { return 1; // indicates error } GetUserInput(ageLowerRange, ageUpperRange, gender, yILowerIncome, yIHigherIncome ); ptntlCstmrs = GetPeopleInAgeRange(ptntlCstmrs, ageLowerRange, ageUpperRange); ptntlCstmrs = GetPeopleWithSpecificGender(ptntlCstmrs,gender); ptntlCstmrs = GetPeopleInIncomeRange(ptntlCstmrs,yILowerIncome,yIHigherIncome); cout << " Number of potential customers = "<