Menu

[solved]-Answer Python Activity 1 File Read Write Last Week S Lab Team Designed Constructed Program Q39083691

ANSWER IN PYTHON
Activity #1: File read and write In last week’s lab, your teamdesigned and constructed a program for performing interpolationcalculations. As a team, you should now work to build essentiallythe same program, extended somewhat (as described below) but in twodifferent parts, one to write and store data in a file, and anotherto read data from the file and answer queries. You may begin withthe code you used last time, if you wish, or you may construct thenew programs from scratch.

a) First, determine as a team how you will store the data in thefile. You want to make sure you have agreement on how entries inthe data file will be stored.

b) Create a program that will read in data and store it in afile. Your program should prompt the user for the name of the fileto use, ask what is being interpolated (the independent anddependent variables, how many data entries there are, and thenrequest values be entered (similar to the way the previous programworked) until the user is done. This data should be written to thespecified file in the format your team chose. a. As an example, youmight first ask for a file name, b. Then you might ask what theindependent variable (i.e. the “x” value) is. The user might enter“time”. c. Then, you might ask what the dependent variable (i.e.the “y” value) is. The user might enter “price”. d. Then you wouldrepeatedly ask the user to enter information (time and price) untildone. All of that should be saved to the file in the format youdescribe.

c) Next, create a program that will prompt the user for a datafile to read, and then will read in the data file, in the formatgiven above. You should prompt the user for the file name. Then,repeatedly ask for values that the user wants to interpolate. Youshould print out each of the interpolated values. a. For example,following the example above, you would ask the user for a time, andthen you would give the price at that time (interpolated orextrapolated from the data you read in from the file). Submit yourtwo programs, clearly indicating by their names which one is tocollect data, and which is to interpolate data.

Expert Answer


Answer to ANSWER IN PYTHON Activity #1: File read and write In last week’s lab, your team designed and constructed a program for… . . .

OR


Leave a Reply

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