Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This part provides you with an opportunity to demonstrate your understanding of the problem - solving approach taught in TM 1 1 2 and Python
This part provides you with an opportunity to demonstrate your understanding of the problemsolving approach taught in TM and Python functions. Decomposition and algorithms are covered in Block Parts and and Block Part Further examples can be found in Block Part How to define your own functions is introduced in Block Part Section You will need an individual number in order to answer this question part. You should find your individual number as shown below before you start the question itself.Box: How to obtain your individual numberPerform the following steps with pen and paper you should not write code for these steps:Write down your PI Personal Identifier Your PI will be different from your OUCU, but like your OUCU, it is unique to you. The PI starts with a letter followed by digits, followed by a check value, which is either a digit or letter.Identify the last three numerical digits that occur in your PI So for instance, if your Open University PI is AX take If your PI is Z you would take Use the three digits from Step lets call them XYZ to create the number XYZ For instance, if you obtained in Step then you now get If you obtained you now would get In your solution document, in answer to Part ii below, write down your PI and the individual number that you have obtained via Steps from your PIWe ask you to make use of the individual number based on your PI so you can demonstrate that your solution to this question part is your own.If you are unclear about how to use your PI to arrive at the individual number, do not hesitate to ask your tutor for advice.Please state your full PI and the individual number you obtained, so your tutor can establish that the digits you use for XYZ in XYZ correspond with the final three digits of your PIYou should read the question all the way through before you start to make sure that you understand the scenario.Background to the problem:In Section of Part of Block Cloud computing, you learned that cloud providers have argued that remote working at home on the cloud is greener than working in an office. The Carbon Trust has, however, pointed out that this is not always true: working at home may cause an overall increase in carbon emissions because it is more efficient to provide lighting and heating to people in an office in comparison to workers running the heating and using lighting in their individual homes.The tipping point in Miles indicates the minimum distance the person needs to travel into work such that home working would be greener for them.Figure of Part Block shows the tipping point in Miles for individual commuters as determined by their commuting distance and mode of transportation. For the purpose of this question, you must use the following table which corresponds with part of Figure :Table : showing for two modes of transportation the tipping point in Miles for individual commutersMode of transportationTipping point in MilesBy trainBy carThe problem:Given some information about a companys employees, you are asked to calculate the percentage of employees for whom working from home is greener than travelling into the office.To compute this percentage, you are provided with information in the form of two lists. The first list has an item for each employee who travels by train to work. The item represents the distance they travel into work. The second list contains the travel distances for those travelling by car. You may assume that all employees travel into work by either train or car.Your task is to use this data to compute the percentage of employees for whom remote work is more environmentally beneficial than their traditional commute to the office.For example, the list for those travelling to work by train could be: and This list has six items, which means that there are six employees who travel into work by train. Each item represents the distance travelled into work by that employee.However, it is known that employees are overreporting the distance travelled. For this reason, before you use the list, you must multiply each distance in the list with your individual number. Suppose your individual number is ; then you would compute the list which has the following items: and According to this list with adjusted distances, out of the six employees who travel by train, for two of them, working from home would be greener.iDevelop an initial decomposition of the problem using the chevron notation and from the module materials. Include your decomposition in your solution document.iiBuilding on your decomposition for part ci develop an algorithm for solving the problem. Include this algorithm in your solution document, and also write down your PI and the individual number that you have obtained via Steps from your PIiii.Write a single Python function definition following the instructions that are provided below.Write a single Python function that implements the algorithm you wrote for part cii Your function must be a translation of your algorithm from part cii otherwise no marks will be awarded.The function should have two arguments: one for each of the two lists. The first argument is bytrain and the second is bycar.The function should have one return value for the percentage of employees for whom working from home is greener than travelling into the office.Save your function in a file called QOUCU.py where OUCU is your OUCU number.When you have completed your work on this part:submit the py file with your functionpaste the function definition from your py file as text with indentation preserved into your solution documentiv.Test the function by calling it with the arguments and in IDLE. Paste the function call and the result as a screenshot into your Solution document.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started