Question: Q 1 : Create a text file with the data given below using notepad or any other editor. Save the file as data . txt

Q1: Create a text file with the data given below using notepad or any other editor. Save the file as data .txt. Write a program that will open the file and read the age of each individual and their name and display it on the command prompt. After reading the entire file, the program must also output the total sum of ages included in the file.
John Adams 25
Patrick Henry 30
Thomas Jefferson 19
George Washington 28
Alexander Hamilton 15
Q 1 : Create a text file with the data given

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!