Question: WRITE ALL THESE PROGRAMS IN PYTHON P6.22 Write a function that computes the average of the neighbors of a table element in the eight directions

WRITE ALL THESE PROGRAMS IN PYTHON

P6.22 Write a function that computes the average of the neighbors of a table element in the eight

directions shown in Figure 12. def neighborAverage(values, row, column)However, if the element is located at the boundary of the table, only include the neighbors that are in the table. For example, if row and column are both 0, there are only three neighbors.

P6.26 A theater seating chart is implemented as a table of ticket prices, like this:

10 10 10 10 10 10 10 10 10 1010 10 10 10 10 10 10 10 10 1010 10 10 10 10 10 10 10 10 1010 10 20 20 20 20 20 20 10 1010 10 20 20 20 20 20 20 10 1010 10 20 20 20 20 20 20 10 1020 20 30 30 40 40 30 30 20 2020 30 30 40 50 50 40 30 30 2030 40 50 50 50 50 50 50 40 30 Write a program that prompts users to pick either a seat or a price. Mark sold seats by changing theprice to 0. When a user specifies a seat, make sure it is available. When a user specifies a price, findany seat with that price.

P7.7 Write a program that checks the spelling of all words in a file. It should read each word of a file and check whether it is contained in a word list. A word list is available on most Linux systems in thefile /usr/share/dict/words. (If you dont have access to a Linux system, your instructor should be able to get you a copy.) The program should print out all words that it cannot find in the word list.

P7.13 Write a program that asks the user to input a set of floating-point values. When the user enters a value that is not a number, give the user a second chance to enter the value. After two chances, quit reading input. Add all correctly specified values and print the sum when the user is done entering data.Use exception handling to detect improper inputs.

P7.27 Write a program that queries information from three files. The first file contains the names and telephone numbers of a group of people. The second file contains the names and Social Security numbers of a group of people. The third file contains the Social Security numbers and annual income of a group of people. The groups of people should overlap but need not be completely identical. Your program should ask the user for a telephone number and then print the name, Social Security number, and annual income, if it can determine that information.

Business P7.29 A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event. Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not existor the format is incorrect.

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 Databases Questions!