المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : حل واجب Mt262b -. > لعام 2013 mt262b tma01 حاليا موجود



أسواق
09-11-2012, 09:20 PM
MT262B, Fall 2012-2013 offer
Units 1-4 of Block III and Unit 1 of Block IV
Question 1 (20 Marks)
This question is d on Block III.
following terms mean: [4 marks each]
i- Prototype system
ii- class
iii- Pointer
iv- OnTimer event
v- Inheritance
Question 2 (45 Marks)
This question is d 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:
We have three edit boxes, three buttons, and two combo boxes. Enter two integer
numbers in the start and end 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.
3
How combo boxes should work?
1. The first combo box consists of two options: Total for adding numbers and Average for finding the average of numbers. The initial value for the combo box is Total.
2. The second combo box consists of three options: AllExcept3 which taking into account all the series numbers except all of multiple 3 numbers (exclude 3,6,9,…), the First5 which taking into account the first five numbers in the series, and the Last5 which taking into account the last numbers in the series. The initial value for the combo box is AllExcept3.
If you choose Total from the first combo box and AllExcept3 from the second edit box then your decision is to add all the series numbers except all of multiple of 3 numbers in the series.
If you choose Total from the first combo box and First5 from the second edit box then your decision is to add only the first 5 numbers in the series.
If you choose Total from the first combo box and Last5 from the second edit box then your decision is to add only the last 5 numbers in the series.
The same previous scenario will be applied if the choice was for Average instead of Total.
 If you press on “Execute” button or if you use the short cut by pressing Alt key + x, the result will be printed in the third edit box (Output) and the focus will be on the start edit box.
 If you press on “Clear” button or if you use the short cut by pressing Alt key + C, all edit boxes will be cleared and the focus will be on the start edit box.
 If you press on “Exit” button or if you use the short cut by pressing Alt key + E, 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.
4
Question 3 (15 marks)
This question is d on Block III – Unit 1 (Graphical User Interfaces), Block III – Unit 2 (Designing Interfaces), and Block III – Unit 3. 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.
Given the following form at run time
The form distinguishes between different colors of lines. Points in the middle of the form have the Xcoordinates of 10, 20, 30, ....... , 290.
Write code for the OnPaint event handler to draw the above shape using a maximum of: two for loop, two if else statements, four MoveTo methods, four LineTo methods only. Do not use any other methods.
What to submit to your tutor:
a. A (you can use Microsoft Word) containing the answers of question one.
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, …
5
c. 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).