1. Below you will find a link to a text file containing a set of x, y values for some function. Suppose you wanted to compute an approximate value for this function at some point x that is not represented in the file. One obvious way to compute an approximation for f(x) is to find the two x values in the file that are closest to the x you want and construct the equation of the line passing through those two known data points. The y value of this line at the x you want will give you an approximation for y = f(x).

Write a program that reads the sequence of x, y pairs from the data file and then prompts the user to enter a value for x. Using the procedure described above, compute and print an approximate y value for the x the user has entered. (You may assume that the user will always enter a value of x that is between the smallest and largest x values represented in the file.)

Data File

2. Below you will find a link to a CSV file containing housing data I used in an example earlier in the term. The CSV file contains sales data for houses with differing numbers of bedrooms. Write a program that can compute and print the average house price for a house with n bedrooms, for all n from 1 to 6.

CSV File