Question: I'm having problems with writing this code. I have added my code below. There are six different files to choose from. strengths3.dat pulsars3.dat strengths3.dat pulsars2.dat

I'm having problems with writing this code. I have added my code below. There are six different files to choose from.

strengths3.dat

pulsars3.dat

strengths3.dat

pulsars2.dat

strengths1.dat

pulsars1.dat

I'm having problems with writing this code. I have added my code

TO DO #2: The getData () Function Write a function named getData () that accepts the names of two (2) files to process as arguments. The getData () function should perform the following: Read the data from the first file (ie: pulsarsl . dat) Read the data from the first file (ie: strengths1 . dat) Creates a new, empty List Combines the line-by-line values read from each file Appends the combined value to the List Repeats until all values have been combined and added to the List Closes both files . Return the List of combined values TO DO #3: The main () Function Write a function named main ( ) that performs the following: Displays a description of the program's purpose Prompts the user for two (2) filenames to process o NOTE: Your program should be flexible, allowing the user to enter any two filenames. Submissions will be tested with multiple different pairs of files to ensure that they meet this requirement . Call the getData () function providing the two (2) filenames as arguments and assign the returned List to a variable Use a for loop to display the first 10 entries of the List on a single row separated by commas

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!