Expert answer:C++, computer science assignment help

Answer & Explanation:Lab I input.txt (40 B) output.txt (15 B) Lab II doubles.txt (18 B)If there any question talk to me.
lab_4_part_i.docx

lab_4_part_ii.docx

Unformatted Attachment Preview

Lab 4 Part I
You are given a text file “input.txt” containing in each line the name of a capital
city followed by the name of the corresponding country separated by tabulation
“t”.
Write a program that reads each line in “input.txt” and appends only the name of
the capital city in “output.txt”.
Note: “output.txt” already contains a line of text. You should add to it and do not
overwrite it.
Example:
input.txt:
Paris France
London
UK
Lisbon
Portugal
Output.txt:
Paris
London
Lisbon
Lab 4 Part II
Write a program that reads a text file “doubles.txt” containing a double in each
line and outputs the sum of all the doubles in all the lines of the file as output.
Example:
Doubles.txt:
1.0
2.2
3.6
=> Output to the console should be 6.8

Purchase answer to see full
attachment

Order a plagiarism free paper now. We do not use AI. Use the code SAVE15 to get a 15% Discount

Looking for help with your ASSIGNMENT? Our paper writing service can help you achieve higher grades and meet your deadlines.

Why order from us

We offer plagiarism-free content

We don’t use AI

Confidentiality is guaranteed

We guarantee A+ quality

We offer unlimited revisions

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top