SlideShare a Scribd company logo
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

PDF
Need to revise working code below,A good design means the applicat.pdf
PDF
MolluscaIdentify the distinguishing characteristics of Phylum Moll.pdf
PDF
Match the directional term with its Correct ipsilateral media in.pdf
PDF
LithiumA. has a very narrow therapeutic range.B. completely cro.pdf
PDF
Let Z be the group of all integers under the operation of addition. E.pdf
PDF
In the United States today, nearly all of our electricity isproduc.pdf
PDF
In a radio link is required to send digital voice at 4800bps,but can.pdf
PDF
hi i have to write a java program involving link lists. i have a pro.pdf
Need to revise working code below,A good design means the applicat.pdf
MolluscaIdentify the distinguishing characteristics of Phylum Moll.pdf
Match the directional term with its Correct ipsilateral media in.pdf
LithiumA. has a very narrow therapeutic range.B. completely cro.pdf
Let Z be the group of all integers under the operation of addition. E.pdf
In the United States today, nearly all of our electricity isproduc.pdf
In a radio link is required to send digital voice at 4800bps,but can.pdf
hi i have to write a java program involving link lists. i have a pro.pdf

More from archgeetsenterprises (20)

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

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Open folder Downloads.pdf yes yes ges yes
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PPTX
master seminar digital applications in india
PPTX
Pharma ospi slides which help in ospi learning
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Insiders guide to clinical Medicine.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Renaissance Architecture: A Journey from Faith to Humanism
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Open folder Downloads.pdf yes yes ges yes
Microbial diseases, their pathogenesis and prophylaxis
PPH.pptx obstetrics and gynecology in nursing
O7-L3 Supply Chain Operations - ICLT Program
01-Introduction-to-Information-Management.pdf
Open Quiz Monsoon Mind Game Prelims.pptx
Cardiovascular Pharmacology for pharmacy students.pptx
Open Quiz Monsoon Mind Game Final Set.pptx
master seminar digital applications in india
Pharma ospi slides which help in ospi learning
Microbial disease of the cardiovascular and lymphatic systems
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Insiders guide to clinical Medicine.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Ad

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)<