Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

b . In this part of the question, you will implement the final steps in the top - level decomposition given at the beginning of

b. In this part of the question, you will implement the final steps in the top-level decomposition given at the beginning of this question:
Find the sum of the items in the transformed list
> If the remainder of the sum divided by 10 is 0, result is valid, else result is invalid
Print the result
So, for example, for this step, if the input is the list:
9,21,8,0,1,12,1,3,8,9,2,3,3
The output valid will be printed.
i. Identify a pattern that could best be applied to the solution of the second task given that you should not use the sum() function. State clearly the name of the pattern and the pattern number, for example 'List generation Pattern 2.2'. A list of all the patterns can be found in the Problem solving and Python quick reference.
[Note, in addition to the pattern you have identified, you will also need to use Pattern 4.2(case analysis, two cases)].
ii. Write an algorithm based on the pattern you have identified.
iii. Implement your algorithm as Python code. This must match the steps of your algorithm and you should use comments in the code to make it clear how the two correspond. Marks will be lost if the program does not follow the algorithm. Your code should include a comment that gives your PI number. Copy your Python code for this second task as text, using an evenly spaced font such as New Courier or Consolas, into your Solution document. Name your Python file Q2b_OUCU.py, where 'OUCU' is your OU computer username, e.g. abc123. Then include the code file in your TMA zip file.
You should aim to use only the Python features that are introduced in the module. If you decide to use techniques or language features that TM112 does not cover
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions