Education In Pakistan

Papers, Notes, Books & Help For Students

UPDATED EDUCATIONAL NEWS INTERVIEW HELP FOR ALL JOBS ONLINE BOOKS SCHOLARSHIPS AVAILABLE INTERNSHIP JOBS

Tag: VU. CS410. Visual .Programming .Mid Term .Examination – .Special .Semster .2005

VU CS410 Visual Programming Mid Term Examination – Special Semster 2005

.

CS410 Visual Programming

Mid Term Examination – Special Semster 2005

Time Allowed: 90 Minutes

Please read the following instructions carefully before

attempting any of the questions:

1. Attempt all questions. Marks are written adjacent to each

question.

2. Do not ask any questions about the contents of this

examination from anyone.

a. If you think that there is something wrong with any of

the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is

missing, make an appropriate assumption and use it to

solve the problem.

c. Write all steps, missing steps may lead to deduction of

marks.

d. All coding questions should be answered using VC++.

You are allowed to write and test your code. If you do so please

remember to copy and paste your code into the examination solution

area. (Do NOT share your code; your colleague could get higher

marks than you!!)

**WARNING: Please note that Virtual University takes serious

note of unfair means. Anyone found involved in cheating will

get an `F` grade in this course.

Total Marks: 55

Question No. 1

Total Questions: 13

Marks : 8

Write a windows procedure function for the above program that explicitly handles

the window closing functionality by pressing any key. This functionality can be

achieved by notifying the WM_CHAR message. You can use DestroyWindow

function for closing the window. You are also required to provide appropriate

functionality against WM_DESTROY and the default message.

Question No. 2

Consider the following code snippet

char x = ‘Z’;

float y = 8;

char *xPtr = &x;

float *yPtr = &y;

Marks : 2

xPtr++;

//1

yPtr++; // 2

What will be the address of xptr and yptr respectively after the execution of

statement 1 and statement 2 (assuming xPtr has the address of 105 and yptr has

the address of 102 initially)

o

o

o

o

o

Question No. 3

106, 106

107, 107

106, 107

107, 106

None of the above

Marks :02

What is a function pointer?

o

o

o

o

o

A pointer that passes as an argument to the function

A pointer that is declared inside the function

Some returning pointer

A pointer that points to the starting address of the function

A pointer that takes return value of some other function

Question No. 4

How many parameters do WinMain function contains

Marks : 02

o

o

o

o

o

5

2

1

3

4

Question No. 5

What is the Difference between __stdcall and __cdecl calling convention?

Question No. 6

Which of the following class of window is pre-registered?

Marks : 03

Marks : 02

o

o

o

o

o

main window

pop-up window

system window

child window

parent window

Question No. 7

Which of the following is not a user defined data type?

Marks : 02

o

o

o

o

o

Structures

Unions

Enumerations

Typedefs

None of the above

Question No. 8

Marks : 05

What are handles? Name three basic types of handles in windows programming.

Question No. 9

Make a program that registers a window class names “Test Window Class”

having following features

o Redraws window if size changes

o Dark gray background color —- using DKGRAY_BRUSH

o Having default application icons

Marks : 20

o With vertical two headed arrow— using IDC_SIZENS

Fill the appropriate window’s structure variables with the required values given

above. Handle of the current instance of the window class should be assigned to

the appropriate structure variable. Set the remaining variables null or zero.

Your program should display a message box that displays a message “Test

Window class can not be registered” incase of failure of registering the window

class. It should also contain OK button and a title of “Error”.

Create a main window named “First Test Window” of the “Test Window” class,

having following features









Overlapped window with Horizontal and vertical scroll bars

Having default horizontal and vertical positions

Width should be 340 and height should be 180

Disabled close button

Your program should display a message box that shows a message “First Test

Window, can not be created” incase of failure. The message box should also

contain an OK button and a title of “Error”.

Implement a message loop for the above created application. The message loop

should retrieve all the messages related to your application from message queue

and then dispatch one by one to the respective windows. The messages should

be dispatched after translating into character form.

Question No. 10

Which of the following is not a feature of windows programming?

Marks : 02

o

o

o

o

o

Resource sharing

Device independent programming

Multitasking

Single path of execution

GDI (Graphics Device interface)

Question No. 11

How many bytes will be allocated to abc;

Union person{

Char name[30];

Int age;

Float height;

};

void main(){

person abc;

}

Marks : 02

o

o

o

o

o

42

38

30

36

28

Question No. 12

——- is a subsystem responsible for displaying text and images on display

devices and printers.

Marks : 02

o

o

o

o

o

Pens

Brushes

GDI (Graphics Device Interface)

Kernel

Operating system

Question No. 13

Marks : 03

Explain system defined messages? Why an application needs these messages?

Education In Pakistan © 2016