Skip to main content

CS504 Current Final Term Fall 2013 Shared by SAm File 6

My Cs504 PAPer 7/3/14
50% of Mcqs were from past papers .
Subjective Part:
Questions Of 2 marks
Q. which design pattern would you suggest for an application where hang in one object state is immediately notified to linked objects? (2)
Ans: Observer Pattern pg n0 140
Q. write the following C statement according to the AnSI standard (2)
int factorial ();
Q. how names representing global variables in C++ should be in coding style guide?
Ans: Global variables in C++ should always be referred to by using the :: operator.
::mainWindow.open() , ::applicationContext.getName() pg no 150
Q. what is Software debugging?
Answer: Software debugging is the process by which developers attempt to remove coding defects from a computer program.
Questions of 3 marks:

Write any three attributes of a program that contribute towards making the program
self documented? (3)
Answer: There are a number of attributes that contributes towards making the program
self documented. These include, the size of each function, choice of variable and other identifier names, style of writing expressions, structure of programming statements, comments, modularity, and issues relating to performance and portability.

Q, How many level of exception safety are there? NAme those levels.
Anwer : Levels of Exception Safety pg no 188
Basic Guarantee: Ensures that temporaries are destroyed properly and there are no
memory leaks.
Strong Guarantee: Ensures basic guarantee as well as there is full-commit or rollback.
No-throw Guarantee: Ensure that a function will not throw.
Q. In the context of three-tier architecture, "interface" of an application represents which layer? (3)
Answer : presentations, application , database (not sure)

Questions of 5 marks :
Q. As a programmes you are instructed to write potable code in order to increase the modality of the software by your team lead . Which points you have to keep in mind to developing a portable code ? (5)
Ans: pg no 179
Q. the code given below contains a bud , identify the bug class and also explain the reason for the bug (5)
char s1[]= "This is a sentence" ;
char *s2;
s2 = (char*) malloc (strlen(s1) +1);
strcpy(s2,s);
Q. Consider the given below statement
*x +=(*xp=2*k<(n-m) ? c [k+1] : d[k--1]));
The above statement is complex ans difficult to read. Re-write the above statement by breaking it into multiple statements to make it more readable .(5) pg no 164
Ans: This statement liberally uses a number of operators and hence is very difficult to follow and understand. If it is broken down into simple set of statements, the logic becomes easier to follow as shown below:
if (2*k < n-m)
*xp = c[k+1];
else
*xp = d[k--];
*x = *x + *xp;
Q. Let's assume we have a system for stock market which provides data for several types of client. We want to have a client implemented as a web based application but in near future we need to add clients for mobile devices , Palm or Pocket Pc , or to have a system to notify the users with SMS alerts Which design pattern is best suited for the above scenario and why ? (5)
Answer:  Observer pattern pg no 140 




Comments

Popular posts from this blog

CS504 Quiz No.3 Shared by Angel

Question # 1 of 10 ( Start time: 09:08:01 PM ) Total Marks: 1 Defining the services of an object means: Select correct option: What it does?        ok What it knows? Who knows it? Whome it knows? Question # 2 of 10 ( Start time: 09:08:27 PM ) Total Marks: 1 Which one of these represents the Krutchen’s 4+1 architectural view model? Select correct option: Logical view, Process view, Physical view, Development view, Use case view Logical view, Dynamic view, Physical view, Development view, Use case view Logical view, Process view, Physical view, Development view, Sequence view Dynamic view, Process view, Physical view, Development view, Use case view Question # 3 of 10 ( Start time: 09:09:50 PM ) Total Marks: 1 Return values in Synchronous messages are represented by: Select correct option: A solid line A dotted line with label        ok A solid line with label Double line Question # 4 of 10 ( Start tim...

CS302 Quiz No.4 Shared by Jawwad

Question # 1 of 10 ( Start time: 01:15:08 PM ) Total Marks: 1  Asynchronous mean that_____________  Select correct option:  Each flip-flop after the first one is enabled by the output of the preceding flip-flop  Each flip-flop is enabled by the output of the preceding flip-flop  Each flip-flop except the last one is enabled by the output of the preceding flip-flop  Each alternative flip-flop after the first one is enabled by Question # 2 of 10 ( Start time: 01:16:36 PM ) Total Marks: 1 A divide-by-10 ring counter requires a minimum of Select correct option: ten flip-flops five flip-flops four flip-flops twelve flip-flops Question # 3 of 10 ( Start time: 01:17:00 PM ) Total Marks: 1 When the number of states are reduced during the design any counter Select correct option: output changes and Input remain unchanged Input changes and output remain unchanged Input and output bith change Input and output remain unchanged Question # 4 of...

CS614 Quiz No.1 Shared by Manzar (UnSolved)

Question # 1 of 10 ( Start time: 03:35:24 PM )   Total Marks: 1 MDX by Microsoft is an example of _______ Select correct option: HOLAP DOLAP ROLAP None of the given options Question # 2 of 10 ( Start time: 03:36:40 PM )   Total Marks: 1 In decision support system ease of use is achieved by: Select correct option: Normalization Denormalization Drill up Drill down Question # 3 of 10 ( Start time: 03:38:07 PM )   Total Marks: 1 Which of the denormalization technique squeezes master table into detail? Select correct option: Pre-joining Horizontal splitting Vertical splitting Adding redundant column Question # 4 of 10 ( Start time: 03:38:28 PM )   Total Marks: 1 The trade-offs of denormalization is/are: Select correct option: Storage Performance Ease-of-use All of the given options Question # 5 of 10 ( Start time: 03:38:46 PM )   Total Marks: 1 ________is usually deployed when expressions can be used to group data together in...