Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This needs to be done in python Quality Control Recently you took a job working

ID: 3825670 • Letter: T

Question

This needs to be done in python

Quality Control
Recently you took a job working for a small manufacturer that produces clips. Your boss has approached you with a programming project. Over the last 2 weeks, the quality control manager has noticed a pattern in the number of defects found per day. He would like you to write a program to analyze the data they have collected. The program needs to do the following:
List the number of pieces produced and the number of defects found.
List the percentage of defects to pieces per day (number of defects/number of pieces)
List the average number of pieces produced and average defects by week and over the 14 day period.
List which day produced the highest percentage of defects per piece and that percentage.
List which day produced the lowest percentage of defects per piece and that percentage.
Program Requirements
Your program will need to do the following:
Feature a menu so that all you need to do is enter a letter and the program will perform the necessary task. Use the following letters to correspond to what the program needs to do: Menu Option Operation LS List the number of pieces produced and the number of defects found per day.
T
Lists the total number of pieces produced, the total number of defects and the percentage of defects per piece. P List the percentage of defects per piece per day.
A
List the average number of pieces and defects by week and then over the 14 day period. H List which day had the highest number of defects per pieces produced
L
List which day had the lowest number of defects per pieces produced. E Exit or exits the program
Allow you to pick numerous tasks before you are done with the program. HINT: you will need a loop here.
Load both the number of defects and pieces produced into arrays/lists when the program loads. In other words, you will not get prompted to load these values separately. Instead you will initialize your arrays with these numbers at the beginning of the program.
Nice clean output.
Utilization of modular programming. At the minimum you should have 5 modules.
Some Help with the Logic
This program will need to use numerous modules. After you code each module, run it to test it and debug it, if necessary. Do not move on to your next module until you have successfully tested the module you are currently working on.
It is all in the Planning
Open up notepad and start to figure out what this program needs to do, the inputs, the outputs, the variables, the 30,000 foot view and your pseudocode. Remember your finished pseudocode should NOT contain Python syntax. Zero points will be given for pseudocode that looks like working Python code.
Page 2 of 4
Time to Code
Once you have your pseudocode written, it is time to code. Open up IDLE and create a new window. Save your file and give it a name. As you are putting your program together keep the following in mind:
Remember the proper flow of a program declare variables at the top, fill the variables, process the variables and print out the variables
Choose good variable names. These are not too long but descriptive.
Take care with your output. This does need to make sense.
Don’t forget your comments! Points will be deducted.
Since this program is a little longer than your lab programs, test as you go. If you type all of your code in and then test at the end, your debugging will last longer.
Use the following data in your arrays/lists Day Pieces Produced Defects Found Wk 1 Monday 10 3
Wk 1 Tuesday
14
5 Wk 1 Wednesday 15 7
Wk 1 Thursday
12
8 Wk 1 Friday 20 9
Wk 1 Saturday
18
2 Wk 1 Sunday 17 5
Wk 2 Monday
9
2 Wk 2 Tuesday 23 7
Wk 2 Wednesday
21
4 Wk 2 Thursday 20 8
Wk 2 Friday
16
5 Wk 2 Saturday 17 6
Wk 2 Sunday
22
9
Once you have your code typed in, test your program. The screenshot below lists the menu I display along with what happens when I enter LS:
Page 3 of 4
When I entered T
When I entered P
When I entered A
When I entered H
Page 4 of 4
When I entered L
Try to get your program to look as much like mine as you can. Utilize the format function and the tab character to line your output up.

Explanation / Answer

import datetime import locale def weekdays(weekday): current_locale = locale.getlocale() if current_locale not in weekdays._days_cache: # Add day names from a reference date, Monday 2001-Jan-1 to cache. weekdays._days_cache[current_locale] = [ datetime.date(2001, 1, i).strftime('%A') for i in range(1, 8)] days = weekdays._days_cache[current_locale] index = days.index(weekday) return days[index:] + days[:index] weekdays._days_cache = {} # initialize cache print(weekdays('Wednesday')) # ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'] # set or change locale locale.setlocale(locale.LC_ALL, 'french_france') print(weekdays('mercredi')) # use French equivalent of 'Wednesday' # ['mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche', 'lundi', 'mardi'] days = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') def weekdays ( weekday ): index = days.index( weekday ) return list( days[index:] + days )[:7] >>> weekdays( 'Wednesday' ) ['Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday'] def weekdays(weekday): days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] index = days.index(weekday) return (days + days)[index:index+7] result = days[days.index(weekday):] + days[:days.index(weekdays)]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote