IFT 194 CH 8.7
1. Mr. Jones always gives True/False tests to his class. His tests always have 20 questions. The maximum class size is 35. He needs a program that will calculate the student’s grades based on the best score A will range from the best score, to the best score minus 2.B will range from the best score minus 3, to the best score minus 4.C will range from the best score minus 5, to the best score minus 6.D will range from the best score minus 7, to the best score minus 8.F will be below the best score minus 8. ## Each student’s ID and test answers will be entered. The output will be each student’s ID, number correct, and grade, along with the single highest score for the class. Develop a solution for Mr. Jones problem. Use four one-dimensional arrays—one for the correct scores and the other three for the needed output. # Q1 ( instructor generated) Given the array of integers from 201 to 300and, given a target number, say, 183, develop a Python program that will read in the array and do a binary search to return the index of that target number. Use the variable names of lower and upper for the search index boundaries and mid for the value at theintervals’ midpoint index.2. A restaurant manager wants to know how many employees are needed at the restaurant each hour of the day. The minimum number of employees needed at any hour is 3. After that, one additional employee is required for each 20 customers. The restaurant is open 24 hours a day. The manager has counted the number of customers for each hour over the 14 days to calculate the needed number of employees for each hour. Develop a solution to output the needed number of employees per hour. (There is no such thing as a partial employee.)#Q2 ( instructor modified Pointer technique question). Use Figure 8.15 as the data set and template, and write a Python program that will produce and print the number of days in a month, given the index of the month. 3. A company has 10 salespeople. The manager needs to know the average dollar amount of sales for each salesperson for a week, and the total dollar amount of sales for the store for each day and for the week. The store is open 7 days a week, and each salesperson gets 2 days off. The data are entered into a two-dimensional array with the days of the week as the columns and the salespeople as the rows. Develop a solution to output the needed information. #Q3 ( instructor modified question , pointer techniques for frequency distributions). Use the first 20 values of figure 8.18d pg 218. and compute the frequency distribution, using Python. Print out as shown. Check it out manually!