CS410 Visual Programming

CS410 Visual Programming
Final Term Examination – Spring 2005
Time Allowed: 150 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.

**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: 50                                Total Questions: 10

Question No. 1           Marks : 02

Windows common controls are implemented in
o
o  Kernel32.dll
  Comctl32.dll
o  User32.dll
o  Gdi32.dll

 Question No. 2                              Marks : 14

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. 3                                Marks : 05

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



Question No. 4          Marks : 02

The application can load its resources when
o  res file is compiled
o
o  res file is linked to the executable file
  rc file is compiled and but not linked yet
o  resource.h file is included
o  None of the above



Question No. 5           Marks : 03

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


Question No. 6                              Marks : 05

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


Question No. 7                                Marks : 02

It is not possible to define our own window messages.

o  True
o  False


Question No. 8          Marks : 04
 How can a combo box be added to the toolbar? Write appropriate function.

Question No. 9           Marks : 02

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

o  Definitions
o
o  Data structures
  Identifiers
o  Editors
o  Size


Question No. 10                             Marks : 02

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

o  True
o  False

Question No. 11                               Marks : 05

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


Question No. 12          Marks : 02

WM_INITDIALOG message is sent by the system:

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


Question No. 13                             Marks : 02

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

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

 Question No. 14                               Marks : 04

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. 15         Marks : 02

Identify the function which is used to change an existing item of the menu at run time

o  AppendMenu
o  InsertMenu
o
o  SetMenuItemInfo
  ChangeMenu
o  AddMenuItemInfo


Question No. 16         Marks : 04

What are the benefit(s) of declaring a resource as DISCARDABLE?



  www.vupages.com

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                                      Total Questions: 13

Question No. 1          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          Marks : 2

Consider the following code snippet

char x = 'Z';  
float y = 8;

char *xPtr = &x;
float *yPtr = &y;

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  106, 106
o  107, 107
o
o  107, 106
  106, 107
o  None of the above


Question No. 3          Marks :02

What is a function pointer?

o  A pointer that passes as an argument to the function
o  A pointer that is declared inside the function
o  Some returning pointer
o
o  A pointer that takes return value of some other function
  A pointer that points to the starting address of the function



Question No. 4          Marks : 02

How many parameters do WinMain function contains
o
  2
  5
o
  1  o
  3  o
o  4

Question No. 5          Marks : 03

What is the Difference between __stdcall and __cdecl calling convention?



Question No. 6          Marks : 02

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

o  main window
o  pop-up window
o  system window
o
o  parent window
  child window



Question No. 7          Marks : 02

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

o  Structures
o
o  Enumerations
  Unions
o  Typedefs
o  None of the above


Question No. 8          Marks : 05

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



Question No. 9          Marks : 20

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 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         Marks : 02

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

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


Question No. 11         Marks : 02

How many bytes will be allocated to abc;
Union person{
Char name[30];
Int age;
Float height;
};
void main(){
person abc;
}

 o  42
o
  30
  38
o
  36  o
o  28


Question No. 12         Marks : 02

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

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


Question No. 13         Marks : 03

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




CS410 Visual Programming
MID Term Examination – Spring 2006
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.
     3. You can consult your handouts while solving the paper.

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


Question No. 1  Marks : 5

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


Question No. 2  Marks : 10

(a) Write down the steps involved in registering a window class mentioning the function names
involved in each step.     [5 Marks]
www.VUPages.com
(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]



Question No. 3  Marks : 2

Message loop ends when the GetMessage() function removes the following message from the
message queue:
  WM_SETFOCUS
  WM_PAINT
  WM_SYSCOMMAND
  WM_QUIT
  All of the given options

Question No. 4  Marks : 10

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

Question No. 5  Marks : 10

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




Question No. 6  Marks : 2

Which one of the following messages has lowest priority?
  WM_SYSCOMMAND
  WM_PAINT
  WM_QUIT
  WM_COMMAND
  All have same priority


Question No. 7  Marks : 5

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


Question No. 8  Marks : 2

We can display symbolic constants instead of numeric values using:   Structures
  Enumeration
  Unions
  Typedef
  Typecasting


Question No. 9  Marks : 2

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:
  Auto
  Static
  Extern
  All of the given options
  None of the given options




Question No. 10  Marks : 2

Which one of the following is not a nonqueued message?
  WM_ACTIVATE
  WM_SETFOCUS
  WM_SETCURSOR
  WM_WINDOWPOSCHANGED
  None of the given options

0 comments:

CS401 Computer Architecture and Assembly Language


www.vupages.com

CS401 Computer Architecture and Assembly Language
Programming
Final Term Examination - February 2005
Time Allowed: 150 Minutes

Instructions
Please read the following instructions carefully before attempting any question:
1.  The duration of this examination is 120 minutes.
2.  This examination is open Handouts.
3.  Answer all questions.
a.  There is no choice.
b.  You will have to answer correctly all questions in this examination to get the
maximum possible marks.
4.  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.
           5.  You have been provided with all assembly tools so you can use assembly tools also.
           6. Your paper contains 4 questions.          
All Coding questions should be answered using the Assembly language syntax.

                                                                       
Total Marks: 60                                      Total
Questions: 4

Question No. 1          Marks : 10

Answer the following Questions briefly.

a.  What is the change in the stack after int instructions is executed?
b.  Why procedures are used and what must be the last executable instruction in a
procedure?
c.  Why cli and sti instructions are used during hooking an interrupt?
d.  What is multitasking?
e.  What are minimum numbers of pins required for serial communication? Also write
their names?


Question No. 2          Marks : 10

Write valid instruction(s) to perform each function specified below.
a.  Provide instruction(s) to read a value from port number 0x312.
b.  Provide instruction(s) to move the value at the top of stack in ip register.
c.  Provide instruction(s) to move value of flag register in ax.
d.  Provide instruction(s) to divide value of ax by 8.
e.  Provide instruction(s) to write value of al at the port 0x12.


Question No. 3          Marks : 10

Write a function "ConvertBinaryToDecimal" that takes the address of a string containing
binary of any decimal number via the stack. The function should print its equivalent decimal
number. For example, if the string is "11011" then after the execution of this function, the
program should print 27 and if the string is "1001" then after the execution of this function, the
program should print 9 on the screen.
(Well commented and well indented program will be given extra mark)
Question No. 4          Marks : 10

Answer the following regarding Protected Mode descriptors

a.  Write the following descriptors in the format

    dd  0x0000FFFF, 0x00CF9A00  

       Assume following values for attributes
1  A bit = 0
2  P bit = 1
3  G bit = 0
4  AVL bit = 1
5  r bit = 0

i. 32 bit, non conforming, execute-only code segment at level 2, with base at
0x00403333 and a limit of 0x0FFFF.

ii.  32-bit Read only data segment at level 0, with base at 0x00A0BBBB and limit of
0x1CCCC.

b.  Write 32 bit physical addresses for the following accesses where Base = 0x00A00000
and Limit = 0x30000, EBX contains 0x00001000, and ESI contains 0x00003000

i. [bx+si]

ii.[ebx+esi-0x0012FD]



  www.vupages.com

CS401 Computer Architecture and Assembly
Language Programming
Final Term Examination – Spring 2005
Time Allowed: 150 Minutes

Instructions
Please read the following instructions carefully before attempting any question:
1.  The duration of this examination is 150 minutes.
2.  This examination is open Handouts.
3.  Answer all questions.
a.  There is no choice.
b.  You will have to answer correctly all questions in this
examination to get the maximum possible marks.
4.  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.
           5.  You have been provided with all assembly tools so you can use
assembly tools also.
           6. Your paper contains 4 questions.
All Coding questions should be answered using the Assembly language
syntax.

                                                  Best of Luck



Total Marks: 50                                Total Questions: 04

Question No. 1           Marks : 10

Answer the following regarding protected mode descriptors:

        Write the values of limit A bit , P bit and AVL bit of the following descriptors.
 1.  dd 0x 00FEADEF , 0x 00B60718
2.  dd 0x F8E2135A , 0 x 13DC1258



Question No. 2                              Marks : 10

Give the short answer of the following:

1.  Why we need to disable the interrupts while calling interrupt INT 80hj.
2.  Why we need to disable interrupts before we attempt to change the stack (i.e. ss
and sp).


Question No. 3                                Marks : 10



I. Consider the following code:

What would be in the variable Find after the execution of the code
given below?

;;-------------------------------------------------------------------------------------------------------------------------------
----
[org 0x0100]
              mov  cx, [num1]            
              mov  ax, 0            

l1:           add  ax, cx            
              sub  cx, 1            
              jnz  l1                

              mov  [Find], ax      
              mov  ax, 0x4c00      
              int  0x21

num1:         dw   15
Find:         dw   0

;;------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------



II. Consider the following code:

What will be the values in num1 and num2 after the execution of the
code given below?


;;------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------
 [org 0x0100]
              mov  ax, [num1]        
              mov  bx, [num2]        
              add  ax, bx                            sub  bx, ax            
              add  ax, bx            
               


              mov  ax, 0x4c00        
              int  0x21

num1:         dw   5
num2:         dw   10


;;------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------




Question No. 4          Marks : 20

Write a function "ShowResult" that takes the address of two memory locations via the
stack, the one pushed first is the address of an array of integers and the second is the
length of that array. The function should print "Yes" if the array is in ascending order and
"No" if it is not.
Some sample output is shown below,
If array is:                                                              Output
5 7 9 13                                                                     Yes
15 7 19 13                                                                  No




CS401
Final Term Examination – Spring 2006
Time Allowed: 150 Minutes
Marks : 1

Int u by
3.  Programmer

gram. Also, write comments in front of
each instruction describing the purpose of that particular instruction.
                                                                                   
rg 0x0100]
ttribute:       dw   0x07              
               
ush ax
 
, 91
   je clrscr              
], 0
   



Question No. 1
err pt Flag is set
1.  Processor
2.  Organization
4.  Any one can set


Question No. 2  Marks : 3

Explain the purpose and working of the following pro
[o
            jmp  start

count:      dw   0                
a
second:      dw   0

timer:      push di
              push cx
              p
              push es
             
    inc word[cs:count]
              cmp word[cs:count]

               jmp exit              

clrscr:       mov  word[cs:count
                mov  ax, 0xb800  
WWW.VUPages.Com
                Connecting VU Students                 mov  es, ax            
                xor  di, di            
te], 0x10
     cmp  word[cs:attribute], 0x77
7
te]      
 
 cld                      
       
xit:          mov  al, 0x20
0, al            
              pop di
              iret                      
4], timer
            mov  [es:8*4+2], cs    
art        

           
              mov  ax, 0x3100        
              int  0x21
 
 AL after each of the
llowing instructions is executed.
Assum ing initial conditions for each part of this question

       mov  al, 0x20          

       add word[cs:attribu

       jbe  next              

        mov word[cs:attribute], 0x0

next:          mov  ah, [cs:attribu
                 mov  cx, 2000          
             
                 rep  stosw      
             
e
                out  0x2

                pop es
                pop ax
                pop cx





start:       xor  ax, ax
              mov  es, ax            
              cli                    
              mov  word [es:8*

              sti                    

              mov  dx, st
              add  dx, 15          
              mov  cl, 4
              shr  dx, cl



Question No. 3  Marks : 3

Suppose AL contains 11001011b and CF= 1. Give the new contents of
fo
e the preced
a.  SHL AL,1
b.  SHR AL, 1
c.  ROL AL, CL if CL contains 2 d.  SAR AL, CL if CL contains 2
Marks : 1

Which flag has a special role in debugging?
on Flag
Marks : 1
 code and tell what will be the final effect on bp value
    mov  bp, sp
   

2.  Value of sp will move to bp
n sp
uesti . 6  Marks : 1

UL and IDIV operate on

rs
s
.  All of the given options
Marks : 1
The siz ctor register in protected mode is

f the given options
Marks : 1
Ans

      e.   RCR A

L,CL if CL contains 3

Question No. 4
1.  Sign Flag
2.  Trap Flag
3.   interrupt F
4.  Directi
lag

Question No. 5

Read the following
      push bp
      mov  bp, sp
      sub  sp, 2

 pop bp
1.  bp will retain its original value
3.  Value of bp will  be less the

       4.      Val

ue of bp will be zero

Q on No

IM

1.  Two's-complement numbe
2.  One's-complement number
3
4.  None of the given options



Question No. 7

e of sele
1.  32 bits
2.  24 bits
3.  16 bits
4.  None o


Question No. 8

wer the following questions: a.  Which processor interrupts the system 18.2 times per second? What are some of its
c.  hardware interrupt is executed?
e execution to whatever it
was doing before the interrupt was triggered?
e.  At which address is the interrupt vector for INT 10h stored?
Marks : 1
   Write t
00 and a
0FFFF.
0x10000.
ssume the values for the attributes bits are A=1, AVL=0, P=1, r=0, G=0, D=1, E=0 and B=1.

practical uses?
b.  What is difference between the fault and trap exception?
When a key is pressed on the keyboard, which
d.  When an interrupt handler finishes, how does the CPU resum



Question No. 9

he following descriptors in the format: dd 0x0000FFFF, 0x00CD9A40
i.  32 bit nonconforming, readable code segment at level 0, with base at 0x003000
limit of 0x
ii.  32 bit writeable data segment at level 2, with base at 0x00B00000 and limit of
 A


Largest Online Community of VU Students


FINALTERM  EXAMINATION
SPRING 2007
CS401 - COMPUTER ARCHITECTURE AND ASSEMBLY LANGUAGE PROGRAMMING (Session - 5 )

Marks: 65
Time: 150min


StudentID/LoginID:
______________________________
Student Name:
______________________________
Center Name/Code:
______________________________
Exam Date:
Wednesday, July 18, 2007



Please read the following instructions carefully before attempting any of the questions:
1. Paper contains 15 questions in all, 10 MCQs and 5 subjective, attempt all questions. Marks are written adjacent to each question.
2.  Do not ask any question about the contents of this paper from any one.
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/instruction for a program, missing steps/instructions may lead to deduction of marks.
 3.   Exam is Closed Book. No handouts or reference material is allowed in exam hall other than rough sheet which will be provided by the examiner.
4.   All the coding language should be based on NASM assembler.
5.   No assembly software is allowed in the exam center.
6.   Use of cell phone during the examination is strictly prohibited, otherwise strict disciplinary action will be taken as per university rules.



For Teacher's use only
Question
1
2
3
4
5
6
7
8
9
10
Total
Marks











Question
11
12
13
14
15






Marks











Question









          

Marks














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

Sun SPARC Processor has a fixed ______________ instruction size.





16bit



32bit



64bit



20bit

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

When the subprogram finishes, the ____________________ retrieves the return address from the stack and transfers control to that location.





RET instruction



CALL instruction



POP instruction



Jump instruction

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

A 32 bit address register can access upto __________ of memory.





1 GB



6 GB



4 GB



2 GB

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

The value of a segment register when the processor is running under protected mode is called ___________________________





segment descriptor



segment selector



global descriptor table



protected register

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

FS and GS are two ___________________ in protected mode.





segment registers



segment selectors



stack pointers



register pointers

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

IRQ 0 interrupt have _______________ priority





low



medium



highest



lowest

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

IDT stands for ______________________.





interrupt descriptor table



individual descriptor table



inline data table



interrupt descriptor table

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

Every bit of line status in serial port conveys _____________ information.





different



same



partial



full

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

There are total _______________ bytes in a standard floppy disk.





1444k



1440k



1280k



2480k

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

An 8x16 font is stored in _________________ bytes.





8



16



4



20

Question No: 11    ( Marks: 10 )

Give answers to these questions. .                                [ 3+4+3]
1.      Differentiate hardware and software interrupts?
2.   Give an example of the priority mechanism in the programmable interrupt controller?
3.   Why memory must be freed using explicit calls to DOS before executing a program?


Question No: 12    ( Marks: 15 )

Part a)
Calculate the physical memory address generated by the following segment offset pairs.        [2 x 2.5]

a.       1DDDh:0436h
b.      1234h:7920h

Part b)
Fill out the corresponding values in HEX in the register table after the execution of each instruction. Every instruction is dependent on the previous instruction and carry flag is reset in the start.                                                                                              [2 x 5]

Instructions
   Al
      Carry Flag
mov al,0x005D


Shr al,0x0003


Mov al,0x003C


Sar al,0x0006


mov ax,0x12D4

















Question No: 13    ( Marks: 10 )

Which BIOS interrupt provides serial port services and list down names of 9 pins of DB-9 connector.                   [10]

Question No: 14    ( Marks: 10 )

Write a program to print your full name followed by your student ID using bios services.              [10]

Question No: 15    ( Marks: 10 )

Describe the following descriptors. Give its type and the value of all their fields:
dd 01234567h, 789ABCDEh




0 comments: