You are on page 1of 6

Faculty of Computer Studies

Course Code: TM111

Course Title: Introduction to computing and information technology 1

Tutor Marked Assignment

Cut-Off Date: TBA Total Marks: 20

Plagiarism Warning:

As per AOU rules and regulations, all students are required to submit their own TMA
work and avoid plagiarism. The AOU has implemented sophisticated techniques for
plagiarism detection. You must provide all references in case you use and quote another
person's work in your TMA. You will be penalized for any act of plagiarism as per the
AOU's rules and regulations.

Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA
work):

I hereby declare that this submitted TMA work is a result of my own efforts and I have not
plagiarized any other person's work. I have provided all references of information that I
have used and quoted in my TMA work.

Important Note:

 For all questions you need to write the full algorithm and implement the algorithm
by using OUBILD script. The student should provide provide one screenshot for
the OUBUILD script and two screenshots for differnt outputs.
 If you will not provide SCREENSHOTs you will lose grades

Name of Student: LAMA ABDULLAH ALBATTAH

Signature:

Date:
Question 1 : …………………………………………………………………………………………………(10 marks)

Let assume we have a list of numbers contains even and odd numbers , so you
need to build an algorithm to make the odd number in the beginning of the list
:and the even number at the end of the list. For example
:List=[5,6,8,3,1,7,10] so after you build the algorithm the result will be as below
List=[5,3,1,7,6,8,10]

To answer question 1, you need to do the following:

arr[] = {12, 17, 70, 15, 22, 65, 21, 90}

Array after separating odd and even numbers :

{12, 90, 70, 22, 15, 65, 21, 17

Algorithm:

 def segregateEvenOdd(arr):
 a=[]
 b=[]
 for i in range(len(arr)):
 if(arr[i]%2==0):
 a.append(arr[i])
 else:
 b.append(arr[i])
 c=[]
 for i in range(len(a)):
 c.append(a[i])
 for i in range(len(b)):
 c.append(b[i])
 return(c)
 # Driver function to test above function
 arr = [5,6,8,3,1,7,10]
 c=segregateEvenOdd(arr)
 print ("Array after segregation "), print(c);..
Implement the algorithm using OUBuild script following the algorithm.

Provide 2 screenshots showing output using two different Lists.


the most efficient algorithm to sort is O(n) time

Question 2: ………………………………………………………………………………….. (5 marks)


According to the following code; you are required to draw the flowchart in details
with clear sequences
Question 3 : …………………………………………………………………………………………………….(5 marks)

If the image contains 800 x 600 pixels, with RGB coloring system, how many
megabytes are required to store this image as a bitmap inside the computer?

600*800*3

1.37MB ≈ 1.4MB
Good luck
End of the question

You might also like