SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
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;
}

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Kürzlich hochgeladen (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

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; }