SlideShare a Scribd company logo
1 of 1
Download to read offline
Simple C++ Programming: Multiple Files
1030Prob2a.txt:
1030Prob2b.txt:
Solution
#include
#include
using namespace std;
int main()
{
ofstream outputFile;
outputFile.open ("sum.txt");
ifstream inputFile1;
inputFile1.open("1030Prob2a.txt");
ifstream inputFile2;
inputFile2.open("1030Prob2b.txt");
double n1, n2;
if (inputFile1.is_open() && inputFile2.is_open()) {
while (!inputFile1.eof() || !inputFile2.eof()) {
n1 = 0;
n2 =0;
inputFile1 >> n1;
inputFile2 >> n2;
outputFile << (n1 + n2)<

More Related Content

More from archgeetsenterprises

Glial cells were originally thought to play a very minor role in the .pdf
Glial cells were originally thought to play a very minor role in the .pdfGlial cells were originally thought to play a very minor role in the .pdf
Glial cells were originally thought to play a very minor role in the .pdfarchgeetsenterprises
 
Fungal reproductive cycle. Place the appropriate label in the correct.pdf
Fungal reproductive cycle. Place the appropriate label in the correct.pdfFungal reproductive cycle. Place the appropriate label in the correct.pdf
Fungal reproductive cycle. Place the appropriate label in the correct.pdfarchgeetsenterprises
 
Explain the concept of distributive justiceSolutiondistributiv.pdf
Explain the concept of distributive justiceSolutiondistributiv.pdfExplain the concept of distributive justiceSolutiondistributiv.pdf
Explain the concept of distributive justiceSolutiondistributiv.pdfarchgeetsenterprises
 
Fecal-oral infections are often a result of _____ droplet transmissi.pdf
Fecal-oral infections are often a result of _____  droplet transmissi.pdfFecal-oral infections are often a result of _____  droplet transmissi.pdf
Fecal-oral infections are often a result of _____ droplet transmissi.pdfarchgeetsenterprises
 
Dr. Z conducts a study examining the effect of socioeconomic status .pdf
Dr. Z conducts a study examining the effect of socioeconomic status .pdfDr. Z conducts a study examining the effect of socioeconomic status .pdf
Dr. Z conducts a study examining the effect of socioeconomic status .pdfarchgeetsenterprises
 
Double branded DNA viruses (select only one answer) all insert their.pdf
Double branded DNA viruses (select only one answer)  all insert their.pdfDouble branded DNA viruses (select only one answer)  all insert their.pdf
Double branded DNA viruses (select only one answer) all insert their.pdfarchgeetsenterprises
 
Discuss the mechanisms by which antibiotic resistance genes can be h.pdf
Discuss the mechanisms by which antibiotic resistance genes can be h.pdfDiscuss the mechanisms by which antibiotic resistance genes can be h.pdf
Discuss the mechanisms by which antibiotic resistance genes can be h.pdfarchgeetsenterprises
 
Develop two biologically relevant and researchable questions comparin.pdf
Develop two biologically relevant and researchable questions comparin.pdfDevelop two biologically relevant and researchable questions comparin.pdf
Develop two biologically relevant and researchable questions comparin.pdfarchgeetsenterprises
 
Describe two methods for communicating the material in an Informatio.pdf
Describe two methods for communicating the material in an Informatio.pdfDescribe two methods for communicating the material in an Informatio.pdf
Describe two methods for communicating the material in an Informatio.pdfarchgeetsenterprises
 
Describe the following structuresfunctions or cells Dermal, vascul.pdf
Describe the following structuresfunctions or cells  Dermal, vascul.pdfDescribe the following structuresfunctions or cells  Dermal, vascul.pdf
Describe the following structuresfunctions or cells Dermal, vascul.pdfarchgeetsenterprises
 
Describe the accounting and finance structure in an organization..pdf
Describe the accounting and finance structure in an organization..pdfDescribe the accounting and finance structure in an organization..pdf
Describe the accounting and finance structure in an organization..pdfarchgeetsenterprises
 
Consider an assembly of thousands of people, all screaming, yelling,.pdf
Consider an assembly of thousands of people, all screaming, yelling,.pdfConsider an assembly of thousands of people, all screaming, yelling,.pdf
Consider an assembly of thousands of people, all screaming, yelling,.pdfarchgeetsenterprises
 
Concrete and cementI) Give an example of non-calcium silicate cem.pdf
Concrete and cementI) Give an example of non-calcium silicate cem.pdfConcrete and cementI) Give an example of non-calcium silicate cem.pdf
Concrete and cementI) Give an example of non-calcium silicate cem.pdfarchgeetsenterprises
 
Compute the total interest and the monthly payments for an add-on i.pdf
Compute the total interest and the monthly payments for an add-on i.pdfCompute the total interest and the monthly payments for an add-on i.pdf
Compute the total interest and the monthly payments for an add-on i.pdfarchgeetsenterprises
 
Compare the views of Piaget and Vygotsky on school instruction in ab.pdf
Compare the views of Piaget and Vygotsky on school instruction in ab.pdfCompare the views of Piaget and Vygotsky on school instruction in ab.pdf
Compare the views of Piaget and Vygotsky on school instruction in ab.pdfarchgeetsenterprises
 
Can molds be unicellular If so, in what conditions and under what c.pdf
Can molds be unicellular If so, in what conditions and under what c.pdfCan molds be unicellular If so, in what conditions and under what c.pdf
Can molds be unicellular If so, in what conditions and under what c.pdfarchgeetsenterprises
 
Calculate the following cross exchange ratesThe dollar is trading.pdf
Calculate the following cross exchange ratesThe dollar is trading.pdfCalculate the following cross exchange ratesThe dollar is trading.pdf
Calculate the following cross exchange ratesThe dollar is trading.pdfarchgeetsenterprises
 
Bouchard Companys stock sells for $21 per share, its last dividen.pdf
Bouchard Companys stock sells for $21 per share, its last dividen.pdfBouchard Companys stock sells for $21 per share, its last dividen.pdf
Bouchard Companys stock sells for $21 per share, its last dividen.pdfarchgeetsenterprises
 
Answer the following question please.The answers I have is wrong, .pdf
Answer the following question please.The answers I have is wrong, .pdfAnswer the following question please.The answers I have is wrong, .pdf
Answer the following question please.The answers I have is wrong, .pdfarchgeetsenterprises
 
a) Research information about the U.S. Governments bailouts. Locat.pdf
a) Research information about the U.S. Governments bailouts. Locat.pdfa) Research information about the U.S. Governments bailouts. Locat.pdf
a) Research information about the U.S. Governments bailouts. Locat.pdfarchgeetsenterprises
 

More from archgeetsenterprises (20)

Glial cells were originally thought to play a very minor role in the .pdf
Glial cells were originally thought to play a very minor role in the .pdfGlial cells were originally thought to play a very minor role in the .pdf
Glial cells were originally thought to play a very minor role in the .pdf
 
Fungal reproductive cycle. Place the appropriate label in the correct.pdf
Fungal reproductive cycle. Place the appropriate label in the correct.pdfFungal reproductive cycle. Place the appropriate label in the correct.pdf
Fungal reproductive cycle. Place the appropriate label in the correct.pdf
 
Explain the concept of distributive justiceSolutiondistributiv.pdf
Explain the concept of distributive justiceSolutiondistributiv.pdfExplain the concept of distributive justiceSolutiondistributiv.pdf
Explain the concept of distributive justiceSolutiondistributiv.pdf
 
Fecal-oral infections are often a result of _____ droplet transmissi.pdf
Fecal-oral infections are often a result of _____  droplet transmissi.pdfFecal-oral infections are often a result of _____  droplet transmissi.pdf
Fecal-oral infections are often a result of _____ droplet transmissi.pdf
 
Dr. Z conducts a study examining the effect of socioeconomic status .pdf
Dr. Z conducts a study examining the effect of socioeconomic status .pdfDr. Z conducts a study examining the effect of socioeconomic status .pdf
Dr. Z conducts a study examining the effect of socioeconomic status .pdf
 
Double branded DNA viruses (select only one answer) all insert their.pdf
Double branded DNA viruses (select only one answer)  all insert their.pdfDouble branded DNA viruses (select only one answer)  all insert their.pdf
Double branded DNA viruses (select only one answer) all insert their.pdf
 
Discuss the mechanisms by which antibiotic resistance genes can be h.pdf
Discuss the mechanisms by which antibiotic resistance genes can be h.pdfDiscuss the mechanisms by which antibiotic resistance genes can be h.pdf
Discuss the mechanisms by which antibiotic resistance genes can be h.pdf
 
Develop two biologically relevant and researchable questions comparin.pdf
Develop two biologically relevant and researchable questions comparin.pdfDevelop two biologically relevant and researchable questions comparin.pdf
Develop two biologically relevant and researchable questions comparin.pdf
 
Describe two methods for communicating the material in an Informatio.pdf
Describe two methods for communicating the material in an Informatio.pdfDescribe two methods for communicating the material in an Informatio.pdf
Describe two methods for communicating the material in an Informatio.pdf
 
Describe the following structuresfunctions or cells Dermal, vascul.pdf
Describe the following structuresfunctions or cells  Dermal, vascul.pdfDescribe the following structuresfunctions or cells  Dermal, vascul.pdf
Describe the following structuresfunctions or cells Dermal, vascul.pdf
 
Describe the accounting and finance structure in an organization..pdf
Describe the accounting and finance structure in an organization..pdfDescribe the accounting and finance structure in an organization..pdf
Describe the accounting and finance structure in an organization..pdf
 
Consider an assembly of thousands of people, all screaming, yelling,.pdf
Consider an assembly of thousands of people, all screaming, yelling,.pdfConsider an assembly of thousands of people, all screaming, yelling,.pdf
Consider an assembly of thousands of people, all screaming, yelling,.pdf
 
Concrete and cementI) Give an example of non-calcium silicate cem.pdf
Concrete and cementI) Give an example of non-calcium silicate cem.pdfConcrete and cementI) Give an example of non-calcium silicate cem.pdf
Concrete and cementI) Give an example of non-calcium silicate cem.pdf
 
Compute the total interest and the monthly payments for an add-on i.pdf
Compute the total interest and the monthly payments for an add-on i.pdfCompute the total interest and the monthly payments for an add-on i.pdf
Compute the total interest and the monthly payments for an add-on i.pdf
 
Compare the views of Piaget and Vygotsky on school instruction in ab.pdf
Compare the views of Piaget and Vygotsky on school instruction in ab.pdfCompare the views of Piaget and Vygotsky on school instruction in ab.pdf
Compare the views of Piaget and Vygotsky on school instruction in ab.pdf
 
Can molds be unicellular If so, in what conditions and under what c.pdf
Can molds be unicellular If so, in what conditions and under what c.pdfCan molds be unicellular If so, in what conditions and under what c.pdf
Can molds be unicellular If so, in what conditions and under what c.pdf
 
Calculate the following cross exchange ratesThe dollar is trading.pdf
Calculate the following cross exchange ratesThe dollar is trading.pdfCalculate the following cross exchange ratesThe dollar is trading.pdf
Calculate the following cross exchange ratesThe dollar is trading.pdf
 
Bouchard Companys stock sells for $21 per share, its last dividen.pdf
Bouchard Companys stock sells for $21 per share, its last dividen.pdfBouchard Companys stock sells for $21 per share, its last dividen.pdf
Bouchard Companys stock sells for $21 per share, its last dividen.pdf
 
Answer the following question please.The answers I have is wrong, .pdf
Answer the following question please.The answers I have is wrong, .pdfAnswer the following question please.The answers I have is wrong, .pdf
Answer the following question please.The answers I have is wrong, .pdf
 
a) Research information about the U.S. Governments bailouts. Locat.pdf
a) Research information about the U.S. Governments bailouts. Locat.pdfa) Research information about the U.S. Governments bailouts. Locat.pdf
a) Research information about the U.S. Governments bailouts. Locat.pdf
 

Recently uploaded

FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 

Recently uploaded (20)

FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 

Simple C++ Programming Multiple Files1030Prob2a.txt1030Prob2b..pdf

  • 1. Simple C++ Programming: Multiple Files 1030Prob2a.txt: 1030Prob2b.txt: Solution #include #include using namespace std; int main() { ofstream outputFile; outputFile.open ("sum.txt"); ifstream inputFile1; inputFile1.open("1030Prob2a.txt"); ifstream inputFile2; inputFile2.open("1030Prob2b.txt"); double n1, n2; if (inputFile1.is_open() && inputFile2.is_open()) { while (!inputFile1.eof() || !inputFile2.eof()) { n1 = 0; n2 =0; inputFile1 >> n1; inputFile2 >> n2; outputFile << (n1 + n2)<