MSCI537编程设计 写作、 辅导Data Sourcing

” MSCI537编程设计 写作、 辅导Data SourcingLancaster University, Department of Management ScienceMSCI530/MSCI537: Data Sourcing, Handling and ProgrammingCoursework (70% for MSCI530 and 100% for MSCI537)Deadline: 12/1/2021 10AM Michaelmas Term Maximum Marks: 1001 Coursework DescriptionThis coursework is composed of three parts, and you are expected to submit six files. You havebeen given the flexibility to structure the code in the way that you think is best following theprinciples of re-usability, maintainability, information hiding and clarity.Part 1 (20 Marks)For this part, you should Submit a file containing a working version of your code. The name ofthis file should be part1.ipynb (programmed in Python with Jupyter Notebook as an Editor).You should also submit a document file named part1.docx containing a copy of your code. Youshould not import any modules/packages for this part.Fiz-Buz is a mathematical game, often encouraged by school teachers. In this game the playerstake turns to count Through numbers (1, 2, 3 etc). If a number either contains a 5, or if it isdivisible by 5 then a player must say Fiz instead of that number. If it either contains a 7, or isdivisible by 7, then they must say Buz instead of that number. If a number meets both Fizand Buz criteria, then they must say Fizbuz.Task 1: (12 marks) Write a Fiz-Buz simulator that will calculate whether a number should berepresented by itself, Fiz, Buz or Fizbuz. The simulator should perform this calculation fornumbers between 1 and n2, where n is a user input, and the results should be displayed in a n ntable. This table should contain a heading containing the title of the program and your name (inthe centre), and it should be surrounded by a box made up of – and | characters. The output ofthe program should thus be as shown below for n = 10.The programs should run without errors and meet the above specification (i.e. by correctlyidentifying Fiz and Buz numbers, and formatting the output correctly as required above).Please Turn OverMSCI530/MSCI537 Data Sourcing, Handling and Programming Page 2 of 4Task 2: (8 marks) These marks will go to programs that are (i) well commented, and have agood style (neatly laid out, with sensible identifiers); and (ii) well structured (for example, byfollowing good programming practices and using functions where appropriate) to show evidence ofwell thought out design. Additionally, the quality of the code will be considered (i.e. some markswill be given for compact efficient algorithms, and compact code).Part 2 (40 Marks)For this part, you should submit a file containing a working version of your code. The nameof this file should be part2.py (programmed in Python with Spyder as an Editor). You shouldalso submit a document file named part2.docx containing your answer to the question below (6pages maximum) and your code (as an appendix – no page limit). In case you want to import anypackages apart from pandas, matplotlib, numpy, math, random, tkinter, pickle, seaborn and normfrom scipy.stats, you should contact the module leader first.A newly appointed Health minister has heard reports that there are some hospitals in Englandwhere the average length of stay of patients is over 2 weeks, whereas in many others the averagelength of stay is under 1 week. This sounds rather odd at face value, but he realises that he doesnot understand much about the activity levels of hospitals, and would like to improve his level ofunderstanding. Suppose that the data file Hospital.csv contains the following data for the 303NHS hospitals in England: Hospital Code identifying hospital ALLPatients Patients admitted in last year Males Male patients admitted in last year Females Female patients admitted in last year Emergencies Emergency patients admitted in last year LOS average length of stay of patients in last year Age average age of patients admitted last year LOS PY average length of stay of patients in previous year Age PY average age of patients admitted previous yearDraw a sample of size 100 from this population and investigate your sample using Python. As atthe lecture, use random state to set your unique starting point for the random number generator.For this coursework question use the last four digits of your library card PLUS 1, i.e. if yourlibrary card ends 4321 type in 4322, and if your library card ends 4329 type in 4330. Recordthese four digits at the top of your answer.Task 1: (10 marks) In no more than 6 pages describe the main features of your sample as ifto a non-statistical health minister. You should include main features of individual variables andof the relationships Between them. You must include Python numerical and graphical output.(The clarity and content of your report are both important – grades will be awarded on quality oftechnical analysis. Your report should not be a discussion of how you used Python to perform thecalculations. You also need to think carefully about which output is relevant to use in the report).Task 2: (30 marks) These marks will go to programs that are well structured (including employingfunctional and object oriented programming concepts), well commented, intuitive to use (i.e.Please Turn OverMSCI530/MSCI537 Data Sourcing, Handling and Programming Page 3 of 4straightforward for me to run your code), generalisable, and flexible (i.e. provide user optionsvia a graphical user interface). The program should run without errors and produces the sameoutput used in your report.Part 3 (40 Marks)For this part, you should submit a file containing a working version of your code. The name ofthis file should be part3.py (programmed in Python with Spyder as an Editor). You should alsosubmit a document file named part3.docx containing a copy of your code. In case you want toimport any Packages apart from pandas, matplotlib, numpy, math, random, tkinter, pickle, seabornand norm from scipy.stats, you should contact the module leader first.Alex owns an auto repair business and has several employees. In this part, you are to write aprogram for Alex that stores/deletes/updates data about employees, calculates and displays thegross pay and more. The tasks below are designed to help you to develop your program in stages.Task 1: (2 marks) Write a class named Employee that holds the following data about an employeein attributes: name (e.g. Ahmed Kheiri), ID (e.g. E182737), department (e.g. IT), job title(e.g. Programmer), hourly pay rate and number of hours worked in a week.Task 2: (2 marks) Law requires that hourly employees be paid time-and-a-half their regularhourly pay rate for work in excess of 40 hours in a week. Therefore, if the employee has workedover 40 hours in a week, he or she gets paid extra for all the hours over 40. Otherwise, the overtimecalculation should be skipped. To give an example, if a persons hourly wage is 12 and he orshe works 60 hours in a week, the persons gross pay should be 840. Implement a method thatcalculates and returns an employees gross pay, including any overtime wages.Task 3: (2 marks) Alexs company has a reputation for providing excellent fringe benefits. Oneof their benefits is a retirement plan for each employee. The company contributes 5 percent of eachemployees gross Pay to their retirement plans. Implement a method that calculates and returnsthe companys contribution to an employees retirement account for a week.Task 4: (2 marks) Now, write a class named ProductionWorker that is a subclass of the Employeeclass. This class has an attribute shift (a boolean data type). The workday is divided into twoshifts: day shift and night shift. The shift attribute will hold a boolean value representing the shiftthat the employee works.Task 5: (2 marks) Now that you have written the classes, write a code that creates objects of thetwo classes and prompts the user to enter data for each of the objects data attributes, and storesthe data in the objects. Implement the str method for a string representation of the objects.Task 6: (12 marks) Update your program so that it stores Employee and ProductionWorkerobjects in a dictionary. Use the ID as the key. The program should present a menu that lets theuser perform the following actions: Look up an employee in the dictionary. Suppose each employee has a unique ID, we couldlook up and retrieve an employees name, department, etc, by entering that employees ID Search for records, for example, enter a department and display a list of all the employeesand production workers matching that departmentPlease Turn OverMSCI530/MSCI537 Data Sourcing, Handling and Programming Page 4 of 4 Add a new employee to the dictionary (i.e. the new object will be added to the dictionarysexisting contents) Change an existing Employees name, department, . . . etc. This will allow us to keep therecords up to date Delete an employee from the dictionary Display all the objects in the dictionary in a suitable table format Quit the programWhen the program ends, it should pickle the dictionary and save it to a file. Each time theprogram starts, it should try to load the pickled dictionary from the file. If the file does not exist,the program should start with an empty dictionary.Task 7: (2 marks) Write a function that stores the data about employees and production workersin a text file named employee.txt. The file should contain a record for each employee andproduction worker from the created dictionary. Each record will be a collection of the followingfields: ID, name, department, job title, gross pay and shift (i.e. day or night – only applied toproduction workers).Task 8: (12 marks) Design a suitable graphical user interface, and produce suitable plots (e.g.pie chart showing the distribution of departments).Task 9: (4 marks) These marks will go to programs that are well structured (using functionalprogramming concepts and follow good programming practices), well commented and intuitive touse (i.e. straightforward for me to run your code).2 Coursework SubmissionThe coursework deadline is 10:00AM, Tuesday 12th January, 2021. In accordance with Universityregulations, work submitted up to three days after the deadline will be classed as late submission(10 marks will be deducted), and after three days as a non-submission. However, if an extensionis given then the rule applies from the date of the extension. The place to submit your files: httpss://modules.lancaster.ac.uk/mod/assign/view.php?id=1435010 for MSCI530 httpss://modules.lancaster.ac.uk/mod/assign/view.php?id=1436880 for MSCI5373 PlagiarismYou must write your own code. Copying code from other students, previous students or any othersource is plagiarism. According to university rules, instances of plagiarism will be treated veryseriously. Penalties are in line with the institutional framework of the University. We will analysethe coursework using plagiarism detection software. Your coursework will be checked against thatof the rest of the class, and against that of previous students. In the days following submission, andat a prearranged time, Selected students will be asked to spend a few minutes on Teams where youwill demonstrate your program to me. I will use this opportunity to ask you to provide informationon your program and explain parts of your code.如有需要,请加QQ:99515681 或WX:codehelp

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导