SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
The program first reads integer participantCount from input, representing the number of pairs of
inputs to be read. Each pair has a string and an integer. One Participant object is created for each
pair and added to vector participantList. Write the PrintParticipantsInRange() function in the
Appointments class using Print() to output all the Participant objects with age between 28 and 78,
both inclusive.
Ex: If the input is:
4 Eve 78 Dan 12 Ari 28 Eli 21
then the output is:
Participant: Eve, Age: 78 Participant: Ari, Age: 28
Note: The vector has at least one element.
CODE:
#include <iostream>
#include <vector>
using namespace std;
class Participant {
public:
void SetDetails(string newName, int newAge);
int GetAge() const;
void Print() const;
private:
string name;
int age;
};
void Participant::SetDetails(string newName, int newAge) {
name = newName;
age = newAge;
}
int Participant::GetAge() const {
return age;
}
void Participant::Print() const {
cout << "Participant: " << name << ", Age: " << age << endl;
}
class Appointments {
public:
void InputParticipants();
void PrintParticipantsInRange();
private:
vector<Participant> participantList;
};
void Appointments::InputParticipants() {
int participantCount;
unsigned int i;
Participant currParticipant;
string currName;
int currAge;
cin >> participantCount;
for (i = 0; i < participantCount; ++i) {
cin >> currName;
cin >> currAge;
currParticipant.SetDetails(currName, currAge);
participantList.push_back(currParticipant);
}
}
/*write code here */
int main() {
Appointments appointments;
appointments.InputParticipants();
appointments.PrintParticipantsInRange();
return 0;
}

Contenu connexe

Similaire à The program first reads integer participantCount from input.pdf

Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C LabNeil Mathew
 
python_lab_manual_final (1).pdf
python_lab_manual_final (1).pdfpython_lab_manual_final (1).pdf
python_lab_manual_final (1).pdfkeerthu0442
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptxANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptxjeyel85227
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2ppJ. C.
 
Compose Camp - Intro.pdf.pdf
Compose Camp - Intro.pdf.pdfCompose Camp - Intro.pdf.pdf
Compose Camp - Intro.pdf.pdfKrishnaSoni261334
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdfsolution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdfparthp5150s
 
Csphtp1 07
Csphtp1 07Csphtp1 07
Csphtp1 07HUST
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
 
Project: Call Center Management
Project: Call Center ManagementProject: Call Center Management
Project: Call Center Managementpritamkumar
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As CompDavid Halliday
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As CompDavid Halliday
 
Java practical(baca sem v)
Java practical(baca sem v)Java practical(baca sem v)
Java practical(baca sem v)mehul patel
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfinfo114
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answersQuratulain Naqvi
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfdevangmittal4
 

Similaire à The program first reads integer participantCount from input.pdf (20)

Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
 
python_lab_manual_final (1).pdf
python_lab_manual_final (1).pdfpython_lab_manual_final (1).pdf
python_lab_manual_final (1).pdf
 
ANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptxANSHUL RANA - PROGRAM FILE.pptx
ANSHUL RANA - PROGRAM FILE.pptx
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
 
Compose Camp - Intro.pdf.pdf
Compose Camp - Intro.pdf.pdfCompose Camp - Intro.pdf.pdf
Compose Camp - Intro.pdf.pdf
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdfsolution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
solution-of-practicals-class-xii-comp.-sci.-083-2021-22 (1).pdf
 
Csphtp1 07
Csphtp1 07Csphtp1 07
Csphtp1 07
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
 
Python.pptx
Python.pptxPython.pptx
Python.pptx
 
Project: Call Center Management
Project: Call Center ManagementProject: Call Center Management
Project: Call Center Management
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
Programming For As Comp
Programming For As CompProgramming For As Comp
Programming For As Comp
 
Oot practical
Oot practicalOot practical
Oot practical
 
Linux_C_LabBasics.ppt
Linux_C_LabBasics.pptLinux_C_LabBasics.ppt
Linux_C_LabBasics.ppt
 
Java practical(baca sem v)
Java practical(baca sem v)Java practical(baca sem v)
Java practical(baca sem v)
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
 
OOP program questions with answers
OOP program questions with answersOOP program questions with answers
OOP program questions with answers
 
PYTHON PROGRAMS
PYTHON PROGRAMSPYTHON PROGRAMS
PYTHON PROGRAMS
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdf
 

Plus de adithvrc

The production function of a restaurant includes items such .pdf
The production function of a restaurant includes items such .pdfThe production function of a restaurant includes items such .pdf
The production function of a restaurant includes items such .pdfadithvrc
 
The parent Rubidium87 has a halflife of 50 billion years .pdf
The parent Rubidium87 has a halflife of 50 billion years .pdfThe parent Rubidium87 has a halflife of 50 billion years .pdf
The parent Rubidium87 has a halflife of 50 billion years .pdfadithvrc
 
The portfolios identified below are being considered for inv.pdf
The portfolios identified below are being considered for inv.pdfThe portfolios identified below are being considered for inv.pdf
The portfolios identified below are being considered for inv.pdfadithvrc
 
The Rings of Saturn There are many planetary subsystems with.pdf
The Rings of Saturn There are many planetary subsystems with.pdfThe Rings of Saturn There are many planetary subsystems with.pdf
The Rings of Saturn There are many planetary subsystems with.pdfadithvrc
 
The residents living in the community of Joy has a big pro.pdf
The residents living in the community of Joy has a big pro.pdfThe residents living in the community of Joy has a big pro.pdf
The residents living in the community of Joy has a big pro.pdfadithvrc
 
The Protocol We present the protocol sequentially though if.pdf
The Protocol We present the protocol sequentially though if.pdfThe Protocol We present the protocol sequentially though if.pdf
The Protocol We present the protocol sequentially though if.pdfadithvrc
 
The route of the planned Galway City outer bypass is entirel.pdf
The route of the planned Galway City outer bypass is entirel.pdfThe route of the planned Galway City outer bypass is entirel.pdf
The route of the planned Galway City outer bypass is entirel.pdfadithvrc
 
The riskiness of publicly traded bond issues is rated by ind.pdf
The riskiness of publicly traded bond issues is rated by ind.pdfThe riskiness of publicly traded bond issues is rated by ind.pdf
The riskiness of publicly traded bond issues is rated by ind.pdfadithvrc
 
The rate of photosynthesis as indicated by oxygen productio.pdf
The rate of photosynthesis as indicated by oxygen productio.pdfThe rate of photosynthesis as indicated by oxygen productio.pdf
The rate of photosynthesis as indicated by oxygen productio.pdfadithvrc
 
The random variable Y with a density function given by fy.pdf
The random variable Y with a density function given by fy.pdfThe random variable Y with a density function given by fy.pdf
The random variable Y with a density function given by fy.pdfadithvrc
 
The program below is written in C++ language using an Object.pdf
The program below is written in C++ language using an Object.pdfThe program below is written in C++ language using an Object.pdf
The program below is written in C++ language using an Object.pdfadithvrc
 
The probability that a patient recovers from a stomach disea.pdf
The probability that a patient recovers from a stomach disea.pdfThe probability that a patient recovers from a stomach disea.pdf
The probability that a patient recovers from a stomach disea.pdfadithvrc
 
The protocol will use the following building blocks The Inn.pdf
The protocol will use the following building blocks The Inn.pdfThe protocol will use the following building blocks The Inn.pdf
The protocol will use the following building blocks The Inn.pdfadithvrc
 
The purpose of this project is to develop a code which will .pdf
The purpose of this project is to develop a code which will .pdfThe purpose of this project is to develop a code which will .pdf
The purpose of this project is to develop a code which will .pdfadithvrc
 
The questionnaires prescreening tools and screening script.pdf
The questionnaires prescreening tools and screening script.pdfThe questionnaires prescreening tools and screening script.pdf
The questionnaires prescreening tools and screening script.pdfadithvrc
 
The Public Company Accounting Oversishit Board PCAOB Whs c.pdf
The Public Company Accounting Oversishit Board PCAOB Whs c.pdfThe Public Company Accounting Oversishit Board PCAOB Whs c.pdf
The Public Company Accounting Oversishit Board PCAOB Whs c.pdfadithvrc
 
The Pulfrich effect demonstrates one way in which the human .pdf
The Pulfrich effect demonstrates one way in which the human .pdfThe Pulfrich effect demonstrates one way in which the human .pdf
The Pulfrich effect demonstrates one way in which the human .pdfadithvrc
 
The purpose of the decision analysis phase is to Identify .pdf
The purpose of the decision analysis phase is to Identify .pdfThe purpose of the decision analysis phase is to Identify .pdf
The purpose of the decision analysis phase is to Identify .pdfadithvrc
 
The previous year had an unemployment rate of 108 nominal.pdf
The previous year had an unemployment rate of 108 nominal.pdfThe previous year had an unemployment rate of 108 nominal.pdf
The previous year had an unemployment rate of 108 nominal.pdfadithvrc
 
The price of a stock fluctuates between 43 and 560 H the .pdf
The price of a stock fluctuates between 43 and 560  H the .pdfThe price of a stock fluctuates between 43 and 560  H the .pdf
The price of a stock fluctuates between 43 and 560 H the .pdfadithvrc
 

Plus de adithvrc (20)

The production function of a restaurant includes items such .pdf
The production function of a restaurant includes items such .pdfThe production function of a restaurant includes items such .pdf
The production function of a restaurant includes items such .pdf
 
The parent Rubidium87 has a halflife of 50 billion years .pdf
The parent Rubidium87 has a halflife of 50 billion years .pdfThe parent Rubidium87 has a halflife of 50 billion years .pdf
The parent Rubidium87 has a halflife of 50 billion years .pdf
 
The portfolios identified below are being considered for inv.pdf
The portfolios identified below are being considered for inv.pdfThe portfolios identified below are being considered for inv.pdf
The portfolios identified below are being considered for inv.pdf
 
The Rings of Saturn There are many planetary subsystems with.pdf
The Rings of Saturn There are many planetary subsystems with.pdfThe Rings of Saturn There are many planetary subsystems with.pdf
The Rings of Saturn There are many planetary subsystems with.pdf
 
The residents living in the community of Joy has a big pro.pdf
The residents living in the community of Joy has a big pro.pdfThe residents living in the community of Joy has a big pro.pdf
The residents living in the community of Joy has a big pro.pdf
 
The Protocol We present the protocol sequentially though if.pdf
The Protocol We present the protocol sequentially though if.pdfThe Protocol We present the protocol sequentially though if.pdf
The Protocol We present the protocol sequentially though if.pdf
 
The route of the planned Galway City outer bypass is entirel.pdf
The route of the planned Galway City outer bypass is entirel.pdfThe route of the planned Galway City outer bypass is entirel.pdf
The route of the planned Galway City outer bypass is entirel.pdf
 
The riskiness of publicly traded bond issues is rated by ind.pdf
The riskiness of publicly traded bond issues is rated by ind.pdfThe riskiness of publicly traded bond issues is rated by ind.pdf
The riskiness of publicly traded bond issues is rated by ind.pdf
 
The rate of photosynthesis as indicated by oxygen productio.pdf
The rate of photosynthesis as indicated by oxygen productio.pdfThe rate of photosynthesis as indicated by oxygen productio.pdf
The rate of photosynthesis as indicated by oxygen productio.pdf
 
The random variable Y with a density function given by fy.pdf
The random variable Y with a density function given by fy.pdfThe random variable Y with a density function given by fy.pdf
The random variable Y with a density function given by fy.pdf
 
The program below is written in C++ language using an Object.pdf
The program below is written in C++ language using an Object.pdfThe program below is written in C++ language using an Object.pdf
The program below is written in C++ language using an Object.pdf
 
The probability that a patient recovers from a stomach disea.pdf
The probability that a patient recovers from a stomach disea.pdfThe probability that a patient recovers from a stomach disea.pdf
The probability that a patient recovers from a stomach disea.pdf
 
The protocol will use the following building blocks The Inn.pdf
The protocol will use the following building blocks The Inn.pdfThe protocol will use the following building blocks The Inn.pdf
The protocol will use the following building blocks The Inn.pdf
 
The purpose of this project is to develop a code which will .pdf
The purpose of this project is to develop a code which will .pdfThe purpose of this project is to develop a code which will .pdf
The purpose of this project is to develop a code which will .pdf
 
The questionnaires prescreening tools and screening script.pdf
The questionnaires prescreening tools and screening script.pdfThe questionnaires prescreening tools and screening script.pdf
The questionnaires prescreening tools and screening script.pdf
 
The Public Company Accounting Oversishit Board PCAOB Whs c.pdf
The Public Company Accounting Oversishit Board PCAOB Whs c.pdfThe Public Company Accounting Oversishit Board PCAOB Whs c.pdf
The Public Company Accounting Oversishit Board PCAOB Whs c.pdf
 
The Pulfrich effect demonstrates one way in which the human .pdf
The Pulfrich effect demonstrates one way in which the human .pdfThe Pulfrich effect demonstrates one way in which the human .pdf
The Pulfrich effect demonstrates one way in which the human .pdf
 
The purpose of the decision analysis phase is to Identify .pdf
The purpose of the decision analysis phase is to Identify .pdfThe purpose of the decision analysis phase is to Identify .pdf
The purpose of the decision analysis phase is to Identify .pdf
 
The previous year had an unemployment rate of 108 nominal.pdf
The previous year had an unemployment rate of 108 nominal.pdfThe previous year had an unemployment rate of 108 nominal.pdf
The previous year had an unemployment rate of 108 nominal.pdf
 
The price of a stock fluctuates between 43 and 560 H the .pdf
The price of a stock fluctuates between 43 and 560  H the .pdfThe price of a stock fluctuates between 43 and 560  H the .pdf
The price of a stock fluctuates between 43 and 560 H the .pdf
 

Dernier

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Dernier (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

The program first reads integer participantCount from input.pdf

  • 1. The program first reads integer participantCount from input, representing the number of pairs of inputs to be read. Each pair has a string and an integer. One Participant object is created for each pair and added to vector participantList. Write the PrintParticipantsInRange() function in the Appointments class using Print() to output all the Participant objects with age between 28 and 78, both inclusive. Ex: If the input is: 4 Eve 78 Dan 12 Ari 28 Eli 21 then the output is: Participant: Eve, Age: 78 Participant: Ari, Age: 28 Note: The vector has at least one element. CODE: #include <iostream> #include <vector> using namespace std; class Participant { public: void SetDetails(string newName, int newAge); int GetAge() const; void Print() const; private: string name; int age; }; void Participant::SetDetails(string newName, int newAge) { name = newName; age = newAge; } int Participant::GetAge() const { return age; } void Participant::Print() const { cout << "Participant: " << name << ", Age: " << age << endl; } class Appointments { public: void InputParticipants(); void PrintParticipantsInRange(); private: vector<Participant> participantList; }; void Appointments::InputParticipants() { int participantCount;
  • 2. unsigned int i; Participant currParticipant; string currName; int currAge; cin >> participantCount; for (i = 0; i < participantCount; ++i) { cin >> currName; cin >> currAge; currParticipant.SetDetails(currName, currAge); participantList.push_back(currParticipant); } } /*write code here */ int main() { Appointments appointments; appointments.InputParticipants(); appointments.PrintParticipantsInRange(); return 0; }