32
WWW.vujannat.ning.COM FINALTERM EXAMINATION Fall 2008 CS410- Visual Programming (Session - 1) Ref No: 318702 Time: 120 min Marks: 75 Student Info StudentID: Center: OPKST ExamDate: 2/4/2009 12:00:00 AM For Teacher's Use Only Q No. 1 2 3 4 5 6 7 8 Total Marks Q No. 9 10 11 12 13 14 15 16 Marks Q No. 17 18 19 20 21 22 23 24 Marks Q No. 25 26 27 28 29 30 31 32 Marks Q No. 33 34 35 36 37 38 39 40 Marks WWW. vujannat.ning .COM Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more. WW

Cs410 Collection of Old Papers

Embed Size (px)

DESCRIPTION

CS410 COLLECTION OF OLD PAPERS

Citation preview

Page 1: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

FINALTERM EXAMINATION

Fall 2008

CS410- Visual Programming (Session - 1)

Ref No: 318702

Time: 120 min

Marks: 75

Student Info

StudentID:

Center: OPKST

ExamDate: 2/4/2009 12:00:00 AM

For Teacher's Use Only

Q No. 1 2 3 4 5 6 7 8 Total

Marks

Q No. 9 10 11 12 13 14 15 16

Marks

Q No. 17 18 19 20 21 22 23 24

Marks

Q No. 25 26 27 28 29 30 31 32

Marks

Q No. 33 34 35 36 37 38 39 40

Marks

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 2: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

Question No: 1 ( Marks: 1 ) - Please choose one

Consider the following statements written in a DLL:

__declspec (dllexport) int Factorial(int);

int Average(int, int);

Which of the following statements is true about the above statements?

► Factorial() and Average() are 2 public functions of the DLL

► Average() is the only public functions of the DLL

► Factorial()is the only public functions of the DLL

► This DLL does not have any public functions

Question No: 2 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets:

► Bind

► Listen

► Accept

► Send

Question No: 3 ( Marks: 1 ) - Please choose one

What will happen if we use PostThreadMessage for a thread that does not have the message

queue?

► Nothing will happen

► It will cause a run time error

► Thread will resume processing

► Its message queue will be created

Question No: 4 ( Marks: 1 ) - Please choose one

To

create semaphore objects which function use by thread?

► CreateSemaphore()

► CreateSemaobject()

► CreateObject()

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 3: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

► Create()

Question No: 5 ( Marks: 1 ) - Please choose one

RFC

stands for

► Request for comments

► Request of connects

► Reference for connect

► Request for cancels

Question No: 6 ( Marks: 1 ) - Please choose one

When every any GDI function call is made or send message or post message function calls are

made then which queuing will create?

► Message Queuing

► Function Queuing

► Process Queuing

► None of the given

Question No: 7 ( Marks: 1 ) - Please choose one

Copy-on-write protection is an optimization that allows multiple processes to map their

virtual address spaces such that they share a physical page until one of the processes

modifies the page. This definition belongs to which technique.

► Lazy evaluation

► Fast evaluation

► Process evaluation

► None of the given

Question No: 8 ( Marks: 1 ) - Please choose one

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 4: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

If

the dialog box procedure returns FALSE, then which message handling will be performed?

► Default

► Instance

► Object

► None of the given

Question No: 9 ( Marks: 1 ) - Please choose one

How many parameters take the dialog box procedure?

► 1

► 0

► 6

► 4

Question No: 10 ( Marks: 1 ) - Please choose one

What does hmenu mean?

► Handle to window

► Handle to the menu

► Handle to child window

► Handle to highest menu

Question No: 11 ( Marks: 1 ) - Please choose one

When the system sends the item's identifier to the owner window?

► When the user chooses a command item from a menu

► When the system chooses a command item from a menu

► When the user click on any window area

► When the system de-select the item menu

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 5: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

Question No: 12 ( Marks: 1 ) - Please choose one

If

the load menu function fails so what will be the return value.

► 0

► False

► Null

► 1

Question No: 13 ( Marks: 1 ) - Please choose one

Who generate a unique handle for each menu?

► System

► User

► Dialog box

► Menu Items

Question No: 14 ( Marks: 1 ) - Please choose one

Which message function determined where to send message.

None of the given

► DispatchMessage

► MessageDispatch

► GetMessage

► None of the given

Question No: 15 ( Marks: 1 ) - Please choose one

In

32-bit windows programming, we are freed from the curse of 64k segments.

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 6: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

► True

► False

Question No: 16 ( Marks: 1 ) - Please choose one

Which function we use to register windows classes in window?

► RegisterClass();

► RegistersClass();

► RegisterWin();

► WinReg();

Question No: 17 ( Marks: 1 ) - Please choose one

Which operator manipulates individual bits?

► Individual Bits

► Linked Bits

► Individual Bytes

► Linked Bytes

Question No: 18 ( Marks: 1 ) - Please choose one

Union Person

{

char name[30]; //30 bytes

int age;

float height;

};

How many bytes will skip after executing ptr = ptr +1.

Union Person abc, *ptr;

Ptr = &abc;

ptr = ptr +1;

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 7: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

► 30 bytes will skip after executing ptr = ptr +1.

► 31 bytes will skip after executing ptr = ptr +1.

► 32 bytes will skip after executing ptr = ptr +1.

► 38 bytes will skip after executing ptr = ptr +1.

Question No: 19 ( Marks: 1 ) - Please choose one

double *ptr is pointer variable which stores double type address.

► True

► False

Question No: 20 ( Marks: 1 ) - Please choose one

____________ is/are type(s) of macro.

► Object-like macro

► Function-like macro

► All of the given

► None of the given

Question No: 21 ( Marks: 1 ) - Please choose one

Which of the following is not true about HTTP?

► It is a protocol

► It is stateless

► It is more difficult to implement than state-aware protocols

► A web browser is HTTP client

Question No: 22 ( Marks: 1 ) - Please choose one

For

TCP/IP, if the port is specified as zero, the service provider assigns a unique port to the

application with a value between ________________.

► 1 and 1024

► 1 and 4000

► 1024 and 5000

► 1024 and 10240

Question No: 23 ( Marks: 1 ) - Please choose one

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 8: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

All

bits in high word of a 32-bit pointer are ____________.

► Non-zero

► Zero

► Two

► None of the given

Question No: 24 ( Marks: 1 ) - Please choose one

An

accelerator _____________ to correspond to a menu command.

► Needs

► Needs not

► Is essential

► Is necessary

Question No: 25 ( Marks: 1 ) - Please choose one

CGI

stands for:

► Control Graphics Interface

► Common Graphics Interface

► Control Gateway Interface

► Common Gateway Interface

Question No: 26 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets:

► Send

► Connect

► Accept

► Bind

Question No: 27 ( Marks: 1 ) - Please choose one

DLU is:

► Handle of a dialog

► Handle of a modal dialog only

► Measure of distance within a dialog box

► Name of a dialog

Question No: 28 ( Marks: 1 ) - Please choose one

Neither the user nor the application can make the owner window active until the _______ is

destroyed.

► Modeless dialog box

► Modal dialog box

► Child control

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 9: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

► All of the given

Question No: 29 ( Marks: 1 ) - Please choose one

When a menu item is clicked, __________ message is sent.

► WM_MENUITEMCLICKED

► WM_MENUCLICKED

► WM_COMMAND

► WM_PAINT

Question No: 30 ( Marks: 1 ) - Please choose one

How many WM_CHAR messages will be generated when Shift+A key combination is pressed

from keyboard and we haven’t called TranslateMessage() before calling DispatchMessage()

function?

► 0

► 1

► 2

► 3

Question No: 31 ( Marks: 2 )

What is a process?

Question No: 32 ( Marks: 2 )

What is HTTP?

Question No: 33 ( Marks: 2 )

Briefly define Modal Loop?

Question No: 34 ( Marks: 3 )

Define briefly Group Box?

Question No: 35 ( Marks: 3 )

Which are the three parts of name when using internet address family?

Question No: 36 ( Marks: 3 )

Define the names of resource-definition statements’ categories?

Question No: 37 ( Marks: 5 )

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 10: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

State three differences between a Window Procedure and a Dialog Procedure?

Question No: 38 ( Marks: 5 )

Define the purpose of connect function with syntax. What does it return?

Question No: 39 ( Marks: 10 )

Define Dynamic Link Libraries in detail? Also explain its relation with memory management?

Question No: 40 ( Marks: 10 )

Show the flow of server and client socket calls using block diagram?

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 11: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

MIDTERM EXAMINATION

Fall 2008

CS410- Visual Programming (Session - 2)

Time: 60 min

Marks: 38

Student Info

StudentID:

Center: OPKST

ExamDate: 11/28/2008 12:00:00 AM

For Teacher's Use Only

Q No. 1 2 3 4 5 6 7 8 Total

Marks

Q No. 9 10 11 12 13 14 15 16

Marks

Q No. 17 18 19 20 21 22

Marks

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 12: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

Question No: 1 ( Marks: 1 ) - Please choose one

WM_PAINT message may be sent when a drop down menu disappear.

► True

► False

Question No: 2 ( Marks: 1 ) - Please choose one

Which message is generated by the system only when any part of application window becomes

invalid?

► WM_BRUSH

► WM_PAINT

► WM_COLOR

► WM_CANVAS

Question No: 3 ( Marks: 1 ) - Please choose one

Which GDI environmental space has limited colors.

► Logical space

► Physical Space

► Virtual Space

► Default Space

Question No: 4 ( Marks: 1 ) - Please choose one

For

whom system registers the system class.

► Window class

► Register class

► Process

► None of given

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 13: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

Question No: 5 ( Marks: 1 ) - Please choose one

Choose Command line user interface

► MS DOS

► MS Windows

► MS Word

► MS Visio

Question No: 6 ( Marks: 1 ) - Please choose one

Pump the blood in the whole body of a human being. This work done by the heart but what will

be the heart of an operation system.

► Kernel

► Win32

► Virtual Memory

► ROM

Question No: 7 ( Marks: 1 ) - Please choose one

__Line__ convert the current _____ in program.

► Line No

► File No

► Page No

► None of given

Question No: 8 ( Marks: 1 ) - Please choose one

We

can undefine already defined preprocessor directive using

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 14: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

► #undef

► #unifdef

► #unenddef

► None of given

Question No: 9 ( Marks: 1 ) - Please choose one

Identifier is not replaced if it appears

► In a comment

► With in a string

► As a part of a long identifier

► All of given

Question No: 10 ( Marks: 1 ) - Please choose one

Union Person

{

char name[30]; //30 bytes

int age;

float height;

};

How many bytes will skip after executing ptr = ptr +1.

Union Person abc, *ptr;

Ptr = &abc;

ptr = ptr +1;

► 30 bytes will skip after executing ptr = ptr +1.

► 31 bytes will skip after executing ptr = ptr +1.

► 32 bytes will skip after executing ptr = ptr +1.

► 38 bytes will skip after executing ptr = ptr +1.

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 15: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

Question No: 11 ( Marks: 1 ) - Please choose one

C

language is an extensible language.

► True

► False

Question No: 12 ( Marks: 1 ) - Please choose one

______ is/are the type(s) of Logical Brushes.

► Solid

► Hatched

► Patched

► All of the given

Question No: 13 ( Marks: 1 ) - Please choose one

____________ is/are type(s) of macro.

► Object-like macro

► Function-like macro

► All of the given

► None of the given

Question No: 14 ( Marks: 1 ) - Please choose one

__________ macro expands to the constant 1, to signify that this compiler conforms to ISO

standard C.

► _STD_

► _STDC_

► _STDC_HOSTED_

► _STDC_VERSION_

Question No: 15 ( Marks: 1 ) - Please choose one

char

(*ptrString)[4][2];

How many bytes will be skipped by the statement ptrString += 2?

► 16

► 1

► 4

► 8

Question No: 16 ( Marks: 1 ) - Please choose one

WW

W.v

uja

nnat

.nin

g.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 16: Cs410 Collection of Old Papers

WW

W.vu

jann

at.n

ing.C

OM

If

we destroy owner window then _____________.

► Only owner window will be destroyed

► Only its owned window will be destroyed

► Both owner and owned window will be destroyed

► The application will be crashed

Question No: 17 ( Marks: 1 )

What will be the type of ptr_b? int *ptr, ptr_b;

Question No: 18 ( Marks: 1 )

How many kinds of macros are there?

Question No: 19 ( Marks: 2 )

What are the GDI environment working space names?

Question No: 20 ( Marks: 3 )

List

down three Pre-Defined GDI objects in window

Question No: 21 ( Marks: 5 )

write a recursive function definition for the following function: int squares(int n); // Precondition: n>=1 // Returns the sum of the squares of the numbers 1 through n. For Example, squares(3) returns 14 because 12+22+ 32 is 14.

Question No: 22 ( Marks: 10 )

what are macros and its types? Explain it with example.

WW

W.v

uja

nn

at.n

ing.C

OM

Visit vujannat.ning.Com For Video Lectures ,previous assigmnets ,Papers,Chat, Study discussions and many more.

WW

W.V

IRT

UA

LIA

NS.

CO

M

Page 17: Cs410 Collection of Old Papers

o Gdi32.dll o User32.dll

Comctl32.dll oo Kernel32.dll

Windows common controls are implemented in

Question No. 1 Marks : 02 Total Marks: 50 Total Questions: 10

**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.

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

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

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

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

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 150 Minutes

Final Term Examination – Spring 2005

CS410 Visual Programming

www.vujannat.ning.com

Page 18: Cs410 Collection of Old Papers

Question No. 8 Marks : 04

o False o True

It is not possible to define our own window messages.

Question No. 7 Marks : 02

How can a dialog be centred? Explain it with example and appropriate function call.

Question No. 6 Marks : 05

Why web servers are required to send MIME type in case of an HTTP reply?

Question No. 5 Marks : 03

o None of the above o resource.h file is included

rc file is compiled and but not linked yet oo res file is linked to the executable file

o res file is compiled The application can load its resources when Question No. 4 Marks : 02

Write the necessary steps to explicitly associate a resource with an application without using the resource editor options?

Question No. 3 Marks : 05

Write pseudo code of a complete program that creates a check box in such a way that on clicking the right mouse button to the check box, it displays a message box that shows a message "right button is clicked". In order to do that you are required to re-use the appropriate system window class and make necessary changes in it before registering again. Also write appropriate function calls and parameters in each step and explain each step clearly.

Question No. 2 Marks : 14

Page 19: Cs410 Collection of Old Papers

o Set the background color of the window o Οutline the shape to be drawn o Retrieve device context

Release device context oo Quit device context

What is the first step the application should do to draw, in a window without using WM_PAINT message?

Question No. 13 Marks : 02

o None of the above o After creating the dialog and before making it visible

After creating and displaying the dialog oo Before creating dialog and after displaying it

o Before creating the dialog WM_INITDIALOG message is sent by the system: Question No. 12 Marks : 02

Explain the basic difference(s) between a message box and a dialog box.

Question No. 11 Marks : 05

o False o True

Child window is confined to its parent's client area only.

Question No. 10 Marks : 02

o Size o Editors

Identifiers oo Data structures

o Definitions What information about the resources is placed in resource.h?

Question No. 9 Marks : 02

How can a combo box be added to the toolbar? Write appropriate function.

Page 20: Cs410 Collection of Old Papers

What are the benefit(s) of declaring a resource as DISCARDABLE? Question No. 16 Marks : 04

o AddMenuItemInfo

ChangeMenu oo SetMenuItemInfo

o InsertMenu o AppendMenu

Identify the function which is used to change an existing item of the menu at run time Question No. 15 Marks : 02

Explain why all the application related messages come directly to the modal dialog box if it is active and not through its owner window's window procedure?

Question No. 14 Marks : 04

Page 21: Cs410 Collection of Old Papers

WWW.vujannat.ning.Com Connecting VU Students

Marks Total10 9 8 7 6 5 4 3 2 1 Question

For Teacher's use only

nyone found involved in cheating will get an `F` grade in this course. A**WARNING: Please note that Virtual University takes serious note of unfair means.

4. The paper is tool independent. 3. You can consult your handouts while solving the paper.

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

problem. missing, make an appropriate assumption and use it to solve the b. If you believe that some essential piece of information is

questions, attempt it to the best of your understanding. a. If you think that there is something wrong with any of the

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

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

of the questions: Please read the following instructions carefully before attempting any

Wednesday, August 16, 2006 Exam Date:

______________________________ Center Name/Code:

______________________________ Student Name:

______________________________ StudentID/LoginID:

Time: 120min

Marks: 50

CS410 - VISUAL PROGRAMMING (Session - 1 )

SPRING 2006

FINALTERM EXAMINATION

Page 22: Cs410 Collection of Old Papers

Question No: 4 ( Marks: 2 ) - Please choose one

CreatTreeView function ►

None of the given options

CreateControl function

CreateWindowEx function

CreateWindow function

TreeView control is created using: Question No: 3 ( Marks: 2 ) - Please choose one

WM_DIALOGCOMMAND ►

WM_COMMAND

WM_INITDIALOG

WM_DIALOGCREATE

WM_CREATE

When a dialog box is created which one of the following messages is generated? Question No: 2 ( Marks: 2 ) - Please choose one

None of the given options ►

Its message queue will be created

Thread will resume processing

It will cause a run time error

Nothing will happen

When we use PostThreadMessage for a thread that has not message queue then: Question No: 1 ( Marks: 2 ) - Please choose one Marks

12 11 Question

Page 23: Cs410 Collection of Old Papers

You have to tell which menu will be associated to the window in both cases. 2. We give NULL as the menu during creating the window. 1. We give the menu handle of IDM_MENU2 during creating the window.

class menu. Now, we have 2 scenarios: IDM_MENU2. While registering the window class in this application, we make IDM_MENU1 the Suppose an application has a window and 2 menu resources, one is IDM_MENU1 and second is Question No: 8 ( Marks: 5 ) pressed. messages. Write down the message sequence sent to the windows procedure when Shift+S keys are Suppose we have called TranslateMessage function before calling DispatchMessage to handle Question No: 7 ( Marks: 5 ) is it so? when it returns the value of “simpleVariable” is lost but that of “staticVariable” is preserved. Why “staticVariable”. The storage class of “staticVariable” is static. Suppose this function is called and integer variables declared in it. One is named “simpleVariable” and other is named We have an application in which there is a function named “TestingFunction”. There are 2 local Question No: 6 ( Marks: 5 )

WM_USER ►

WM_QUIT

WM_CREATE

WM_SYSCOMMAND

WM_COMMAND

Which of the following is an application defined message: Question No: 5 ( Marks: 2 ) - Please choose one

Destroying window ►

Creating or registering window

Repainting window

Registering window

Creating window

Menu resource should be associated with a window while:

Page 24: Cs410 Collection of Old Papers

thread? thread function is MyFunction. What would be the entry point and exit point of this secondary CreateThread function. Security Attribute parameter is set to NULL, stack size is 512KB and An application whose primary thread’s entry point is WinMain creates another thread using Question No: 12 ( Marks: 5 ) (This function will not run on Visual C++ or Dev C++ compilers) LongToString(ClientHeight);

follows: convert the value of “ClientHeight” to string and store it in “strClientHeight” proceed as e.g. If “ClientHeight” is a long variable and “strClientHeight” is a string variable then to

Note: To convert a long value into string, simply use LongToString function. and when clicked displays the height of window’s client area through message box. window’s client area through message box while the other button has text “Height” printed on it buttons. One button has text “Width” printed on it and when it is clicked it displays the width of Write WinMain and window procedure of an application that creates an overlapped window with 2 Question No: 11 ( Marks: 10 ) these menu items. and ID_FILE_CLEAR respectively. Write down the resource statements to add accelerators for Suppose we have 2 menu items named “Show” and “Clear”. Their identifiers are ID_FILE_SHOW Question No: 10 ( Marks: 5 ) the application requests 10 elements of that array? of 800MB whose each element is of 512KB. How will operating system handle the situation when We have 128MB RAM in our system. Suppose we run a Win32 application that declares an array Question No: 9 ( Marks: 5 )

Page 25: Cs410 Collection of Old Papers

www.vujannat.ning.com

(a) Write down the steps involved in registering a window class mentioning the function names involved in each step. [5 Marks]

Question No. 2 Marks : 10

Explain briefly how can an application perform more than one task at a time in windows environment?

Question No. 1 Marks : 5

**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.

3. You can consult your handouts while solving the paper.

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

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

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

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

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 90 Minutes

MID Term Examination – Spring 2006 CS410 Visual Programming

Page 26: Cs410 Collection of Old Papers

We can display symbolic constants instead of numeric values using: Question No. 8 Marks : 2

Explain briefly how we can invoke WM_PAINT message when no region of the window has become invalid.

Question No. 7 Marks : 5

All have same priority WM_COMMAND WM_QUIT WM_PAINT WM_SYSCOMMAND

Which one of the following messages has lowest priority? Question No. 6 Marks : 2

Write the WinMain and RegisterWindow functions of an application that creates a simple overlapped window with white background.

Question No. 5 Marks : 10

Write down the WinMain function of an application that creates a window of a pre-registered (system) window class.

Question No. 4 Marks : 10

All of the given options WM_QUIT WM_SYSCOMMAND WM_PAINT WM_SETFOCUS

Message loop ends when the GetMessage() function removes the following message from the message queue:

Question No. 3 Marks : 2

(b) Write down the steps involved in creating a window of a particular class (not a system class) and dispatching messages from application message queue to window message queue mentioning the function names involved in each step. The window has been already registered by us. [5 Marks]

Page 27: Cs410 Collection of Old Papers

None of the given options WM_WINDOWPOSCHANGED WM_SETCURSOR WM_SETFOCUS WM_ACTIVATE

Which one of the following is not a nonqueued message? Question No. 10 Marks : 2

None of the given options All of the given options Extern Static Auto

We want to declare a variable in a function such that whenever the function is called, the variable is not reinitialized. The storage class of the variable must be:

Question No. 9 Marks : 2

Typecasting Typedef Unions Enumeration Structures

Page 28: Cs410 Collection of Old Papers

Question No. 1 Marks : 8

Total Marks: 55 Total Questions: 13

**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.

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!!)

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

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

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

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

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

Please read the following instructions carefully before attempting any of the questions:

Time Allowed: 90 Minutes

Mid Term Examination – Special Semster 2005 CS410 Visual Programming

www.vujannat.ning.com

Page 29: Cs410 Collection of Old Papers

How many parameters do WinMain function contains

Question No. 4 Marks : 02

A pointer that points to the starting address of the function oo A pointer that takes return value of some other function

o Some returning pointer o A pointer that is declared inside the function o A pointer that passes as an argument to the function

What is a function pointer?

Question No. 3 Marks :02

o None of the above

106, 107 oo 107, 106

o 107, 107

o 106, 106

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)

yPtr++; // 2 xPtr++; //1 float *yPtr = &y; char *xPtr = &x; float y = 8; char x = 'Z'; Consider the following code snippet

Question No. 2 Marks : 2

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.

Page 30: Cs410 Collection of Old Papers

o Having default application icons o Dark gray background color ---- using DKGRAY_BRUSH o Redraws window if size changes

Make a program that registers a window class names "Test Window Class" having following features

Question No. 9 Marks : 20

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

Question No. 8 Marks : 05

o None of the above

o Typedefs

Unions oo Enumerations

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

Question No. 7 Marks : 02

child window oo parent window

o system window o pop-up window o main window

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

Question No. 6 Marks : 02

What is the Difference between __stdcall and __cdecl calling convention?

Question No. 5 Marks : 03

oo 4

o 3

o 1

5 o 2

Page 31: Cs410 Collection of Old Papers

} person abc; void main(){

}; Float height; Int age; Char name[30];

Union person{ How many bytes will be allocated to abc;

Question No. 11 Marks : 02

o GDI (Graphics Device interface) o Single path of execution o Multitasking o Device independent programming o Resource sharing

Which of the following is not a feature of windows programming? Question No. 10 Marks : 02

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.

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".

• Disabled close button • Width should be 340 and height should be 180 • Having default horizontal and vertical positions • Overlapped window with Horizontal and vertical scroll bars

Create a main window named "First Test Window" of the "Test Window" class, having following features

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".

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.

o With vertical two headed arrow--- using IDC_SIZENS

Page 32: Cs410 Collection of Old Papers

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

Question No. 13 Marks : 03

o Operating system o Kernel o GDI (Graphics Device Interface)

Pens oo Brushes

------- is a subsystem responsible for displaying text and images on display devices and printers.

Question No. 12 Marks : 02

oo 28

o 36

38 o 30

o 42