Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Faculty of computer studies

MT262B: Putting Computer Systems to Work.


(Visual Programming with C++)

MT262B, Spring 2010-2011 offer

Assignment Booklet

Content Cut-off date:


TMA MT262B 30 April 2011
Units 1-4 of Block III and Unit 1 of Block IV

Please send all your answers to each tutor-marked assignment (TMA) to reach your tutor on or
before the appropriate cut-off date shown above.

The marks allocated for each part of the assignment question are indicated in brackets at the
beginning of the corresponding part.

Plagiarism Warning:
As per AOU rules and regulations, all students are required to submit their own TMA work and
avoid plagiarism. 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.

1
TMA MT262B Cut-off date 30 April 2011

Please use a compressed file (.zip or .rar) containing your answers. Please use the following
format for the name of the compressed file containing your solution:

MT262B-TMA-Spring-2011-Branch Name-Student ID-Student Name

Replace “Branch Name” with the name of your branch


Replace “Student ID” with your ID
Replace “Student Name” with your name

Question 1 (15 Marks)

This question is based on Block III.

Explain in your own words (not more than 20 words) what each of the following terms
mean: [3 marks each]

i- Events tab

ii- VCL

iii- Prototype system

iv- OnTimer event

v- A stack

Question 2 (40 Marks)

This question is based on Block III – Unit 1 (Graphical User Interfaces) and Block III –
Unit 2 (Designing Interfaces). It is intended to test your ability to work with Boralnd’s
IDE to develop a simple application and make use of the IDE’s help system.

Write a C++ code to implement the following application. Make sure to define all
variables that you will use:

2
Enter two integer numbers in the first (From) and second (To) edit boxes respectively.
The two entered values represent the starting and ending values of a series respectively.
Negative values are not allowed and the starting value must be greater or equal to the end
value, otherwise the calculation will not take place and the result will always be zero.

Two combo boxes are existing:


1. The operation combo box which consists of two operations: Sum for summation
and Mult for multiplication. The initial value for the combo box is Sum.
2. The specification combo box which consists of three options: All which taking
into account all the series numbers, the Odd which taking into account the odd
numbers in the series, and the Even which taking into account the even numbers
in the series. The initial value for the combo box is All.

If you choose Sum from the operation combo box and All from the specification edit box
then your decision is to sum all the series numbers.
If you choose Sum from the operation combo box and Odd from the specification edit
box then your decision is to sum only the odd numbers in the series.
If you choose Sum from the operation combo box and Even from the specification edit
box then your decision is to sum only the even numbers in the series.

The same previous scenario will be applied if the choice was for Mult instead of Sum.

 If you press on “Calculate” button or if you use the short cut by pressing Alt key + c,
the result will be printed in the result edit box and the focus will be on the Form edit
box.
 If you press on “Clear” button or if you use the short cut by pressing Alt key + r, all
edit boxes will be cleared and the focus will be on the Form edit box.
 If you press on “Exit” button or if you use the short cut by pressing Alt key + x, the
application will be closed.

The initial design is shown as below and you should make sure to follow the same design
given to you.

3
Question 3 (40 marks)

This question is based on Block III – Unit 1 (Graphical User Interfaces), Block III – Unit
2 (Designing Interfaces) and Block IV – Unit 1 (Introduction to Computer Graphics). It is
intended to test your ability to work with Borland’s IDE to develop a simple application
and make use of the IDE’s help system.

Enter an integer number in the left edit box which consists of, at most, 4 digits. If the
number’s digits are more than 4 digits then the edit box will be cleared and the focus will
be on the same edit box in order to enter a new valid value. If you entered a negative
number then the absolute value of the number will took place before further calculations.

Write a C++ code to implement the following application:

 If you press on “Draw” button:


1. the entered number will be represented by balls from left to right as shown
in the given design. You should follow exactly the design given to you
(shapes, line colors, filling colors, arrangements of balls, etc).

4
2. The number will be printed in the most right edit box where you could not
update it.
3. The left edit box will be cleared and the focus will be on it.

 If you press on “Exit” button, the application will be closed.

The run time design when the value 1234 is entered is shown as below.

Question 4 (5 Marks)

This question is a practice of using our ELibrary.

Write in not more than 5 lines the advantages and disadvantages of using Borland C++ /
version 5.

5
What to submit to your tutor:
a. A text document (you can use Microsoft Word) containing the answers of
questions one and four.
b. One folder containing the solutions of questions two and three. For each solution,
you should submit question files that end with the extensions: .bpr, .res, .dfm, .lib,
.cpp, .h. Any other extension is not required such as .obj, .~cpp, …
c. Name your application of each question by the number of the question itself (eg.:
The project file and the cpp file of question 2 must be Q2.bpr and Q2U.cpp and so
on).

You might also like