0% found this document useful (0 votes)
154 views6 pages

Introduction To Computing and Information Technology 2 Mid-Term Examination Makeup

This document contains a makeup midterm exam for a computing course. It has three parts: 1) multiple choice questions worth 10 marks, 2) short answer questions worth 20 marks, and 3) programming/problem solving questions worth 30 marks. The exam tests students' knowledge of computing fundamentals like hardware, software, algorithms, and programming in Python. It contains questions that require defining terms, writing code, and analyzing sample programs and their output.

Uploaded by

Khalid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views6 pages

Introduction To Computing and Information Technology 2 Mid-Term Examination Makeup

This document contains a makeup midterm exam for a computing course. It has three parts: 1) multiple choice questions worth 10 marks, 2) short answer questions worth 20 marks, and 3) programming/problem solving questions worth 30 marks. The exam tests students' knowledge of computing fundamentals like hardware, software, algorithms, and programming in Python. It contains questions that require defining terms, writing code, and analyzing sample programs and their output.

Uploaded by

Khalid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Faculty of Computer Studies

TM112

Introduction to Computing and Information


Technology 2

Mid-term Examination
Makeup
Spring Semester
2018-2019
Solution

Number of Exam Pages: (6) Time Allowed: 120 Minutes


(including this cover sheet)

Instructions:
1. Write the answers on the separate answer booklet
2. Total marks: 60 marks
3. The exam consists of three parts:
A. MCQ Questions (10 marks): You should answer all questions.
B. Short-Answer Questions (20 marks): You should answer all questions.
C. Programming/Problem Solving Questions (30 marks): You should answer all questions.
4. The use of calculators is not allowed
TM112 Midterm-Exam- Makeup Spring 2018-2019

PART 1: Multiple Choices questions [5 x 2 = 10 Marks]

Answer all the following questions by choosing the most correct statement.
You should dedicate approximately 10 minutes for this part.

1- Data should be moved into _____ from main memory before it is needed by the processor:
a- ROM c- Hard Disk
b- ALU d- Cache memory

2- If a memory loses its content when the power is switched off, then we call it:

a. Non-volatile c. Volatile.
b. ROM. d. Both b and c

3- Which of the following is not a secondary memory?

a- Hard disk drive c- Flash memory


b- Solid-state drive d- None of the mentioned.

4- The register within the ALU where calculations take place is sometimes referred to as the:

a- Status register c- Accumulator


b- General purpose register d- Data Register

5- The task of converting the source code into machine language is carried out by special
programs called?
a- Assemblers c- Translators.
b- Compilers d- Machine Language.

PART 2: Short Answer Questions [20 Marks]

This part consists of 4 questions. You must attempt all questions. You should dedicate

approximately 40 minutes for this part.

Question 1: [5 marks]

Define the following:

a- Assembly language

b- Virtualisation

2/6
TM112 Midterm-Exam - Makeup Spring 2018-2019

Answer: (5 marks: 2.5+2.5)

a- Assembly language is a programming language that uses human-readable symbolic

instructions and symbolic addresses that translate into machine language instructions on a

one-to-one basis.

b- Virtualisation is a term used to describe any configuration where a physical computer

system is emulated using software.

Question 2: [5 marks]

List four functions provided by the operating system.

Answer: [5 marks: 1 mark for each]

Any of the below functions and their explanation:

• Provision of a user interface

• Management of multiple programs

• Management of memory

• Coordination and control of peripheral devices

Question 3: [5 marks]

Consider the following code that is free of errors:

total = 0
for index in range(1, 5):
print( total + index)
total= total + index
print(total)

What will be the output of the above program?

Answer: (5 marks: 1 mark for each line)


The output:
1
3
6
10
10

3/6
TM112 Midterm-Exam - Makeup Spring 2018-2019

Question 4: [5 marks]

Convert the following numbers as indicated, showing your detailed work:


a- 110011, from binary to decimal
b- 105, from decimal to binary

Answer: (5 marks)

a- (2.5 marks: 1.5 marks for the result, 1 mark for showing the steps): 51
b- (2.5 marks: 1.5 marks for the result, 1 mark for showing the steps): 1101001

PART 3: Programming/Problem Solving Questions [30 Marks]

This part consists of 3 questions. You must attempt all questions. You should dedicate
approximately 60 minutes for this part.
Question 1: [10 marks]

Write a python program that implements the following algorithm:


- Prompts the user to enter the MTA grade.
- Prompts the user to enter the TMA grade.
- If total of both grades is less than 15, then print the total and the message “The student
failed the course!”, otherwise, print the total and the message “the student is qualified to sit
for the final exam”
N.B: the grades might contain fractions.
The expected layout of the program execution should be as follows:
Enter the MTA grade: 9.5
Enter the TMA grade: 5.5
15.0 : The student is qualified to sit for the final exam
Or
Enter the MTA grade: 6.5
Enter the TMA grade: 6
12.5 : The student failed the course!

4/6
TM112 Midterm-Exam - Makeup Spring 2018-2019
Answer:
MTA = float(input("Enter the MTA grade: "))
TMA = float(input("Enter the TMA grade: "))
total=MTA+TMA
if total<15:
print(total ,': The student failed the course!')
else:
print(total,': The student is qualified to sit for the final exam')

or any equivalent code

Question 2: [10 marks]

Design the algorithm and implement a program that draws a rectangle with a width=50 and with a
height =25, using the turtle.
N.B: You should use a loop in your work.
Answer: (4+6)
The algorithm will be as follows:
>> Draw a rectangle
For sides from 1 to 2
Draw a line of length 50 units
Turn right by 90 degrees
Draw a line of length 25 units
Turn right by 90 degrees

Implementation in Python:
# Draw a rectangle
from turtle import *
for sides in range(2):
forward(50)
right(90)
forward(25)
right(90)

or any equivalent code

5/6
TM112 Midterm-Exam - Makeup Spring 2018-2019

Question 3: [10 marks]

A simple use of the if, elif, and else statements is to assign letter grades for the scores.

Suppose that scores are assigned letter grades as follows:

- Scores that are 90 and above are A’s.


- Scores that are in the 80s are B’s.
- Scores that are in the 70s are C’s.
- Scores that are in the 60s are D’s.
- Any score below 60 is considered an F.

Write a Python program that does the following:

a- Prompt the user to input a numeric grade.


b- Print the proper letter grade for this numeric grade as per the above criteria.
c- What should you add to your program to let the process repeat 100 times? Write the proper piece of
code.

Answer: (students’ answers may vary, please consider any valid answer)

a- (2 marks):
grade= eval (input (‘Enter your numeric grade’))
b- (6 marks):

c- (2 marks):
for i in range(100):
_____________________________________________________________________________
End of Questions

6/6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy