ou 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 computer science assignment help
Lab 4
1-
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
2- 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
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

