Thread: Semester Examination Questions...Please somebody help me my exam is on 9th May..

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    225

    Semester Examination Questions...Please somebody help me my exam is on 9th May..

    hello,
    these are the few questions in which i face difficulty while solving the previous years semester papers. Please give me appropriate answers. You can also direct me to some useful links on which i can get answers without wasting too much time by reading at a glance since there are hardly 3 days left for my exams. Please help me


    1) What are the advantages of passing arguments by reference?? (3 marks)

    the only advantage that i know is that when you want to modify values in calling function you have to use call by reference. Also when you dont want to make unnecessary copies of variables you can use const along with pass by reference.

    Apart from these if anybody knows some other advantages then kindly tell me


    2)Differentiate between overloading and overriding?? (4 marks)


    3)Why are static member functions prohibited from accessing ordinary member variables?? (3 marks)


    4) "Use abstract base class to declare interface", Justify this statement. Also give example (6 marks)

    5)Each C++ object possesses 4 member functions (which can be declared by the programmer explicitly or by the implementation if they are not available). What are those 4 functions? (4 marks)


    6) TRUE or False : A class with pure virtual function can be initiated. Also give reason (2 marks)


    7)Write overloaded functions to convert an ascii string to int and to convert ascii string to float ( 5 marks)

    The problem which i am facing in the above question is that functions can't be overloaded on their return type i.e there must be atleast 1 input parameter different in the function.But in these 2 functions no paramater would be different.Hence ambiguity!! How to solve it???

    8)What are template functions? is it possible to call the template function with user define/class data type? if yes then how?? (3 marks)

    9)What is OMT? List three kinds of OMT models and what is represents? (3 marks)

    10)What is strict type checking?Give benefits of strict type checking (2 marks)

    11)Differentiate between binary file and ASCII files (4 marks)

    12)Explain term : Delegation (2 marks)

    13)Demerits of Object oriented Programming???? (5 marks)

    14) What is persistency?? Is it supported in C++?? (3 marks)

    15)Write note on dynamic verses static binding (5 marks)


    The marks are given at the end of the every question. If marks are more then please explain in detail.. Thanks in advance!!


    Please help me. I am in dire need of it. Theory exams are from 9th..

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Also when you dont want to make unnecessary copies of variables you can use const along with pass by reference.
    This should give you an idea that there is some other reason for this except reference - size of the data you put on stack

    It is a difference how much data you copy - only 4 bytes of address or the full object size
    Also - you avoid calling copyconstructor this way - it could be the only way to pass parameter for objects that are not copiable...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    The larch
    Join Date
    May 2006
    Posts
    3,573
    7)Write overloaded functions to convert an ascii string to int and to convert ascii string to float ( 5 marks)

    The problem which i am facing in the above question is that functions can't be overloaded on their return type i.e there must be atleast 1 input parameter different in the function.But in these 2 functions no paramater would be different.Hence ambiguity!! How to solve it???
    Think of "out parameters" and perhaps return boolean to indicate success/failure?

    You'll probably need to show more effort on the other questions. Googling can help, C++ FAQ Lite also provides information that might be useful for answering some of the questions.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  4. #4
    Registered User
    Join Date
    Jan 2008
    Posts
    225
    please somebody give replies.!! help me

  5. #5
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Seems like you have gotten hold of your Question paper before the exams

    If you are supposed to refresh the above material, then it is ok, otherwise, a detailed explanation of all these questions

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    225
    Ya ya refresh me. Help me in whatever manner you can!
    refresh me or give detail explanation, do whatever you are comfortable with but DO!!!

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Quote Originally Posted by chottachatri View Post
    please somebody give replies.!! help me
    Why? So when you get a job years from now you can ask your coworkers - maybe one of us - to do your work for you, too?

  8. #8
    Banned
    Join Date
    Nov 2007
    Posts
    678
    Aey! Yeda samjhela hai kya??

    [Do you think I am mad?]

  9. #9
    Super unModrator
    Join Date
    Dec 2007
    Posts
    321
    Just Google!
    http://wiki.answers.com/Q/What_are_t...ted_data_model

    Differentiate between binary file and ASCII files
    wha! 4 marks for that?

    Binary file is made up of 0 and 1, ASCII files are full of all ASCII characters.

    edit:

    All other questions are over my head. Probably that's another disadvantage of OOP -- its difficult for me
    Last edited by abh!shek; 05-05-2008 at 06:58 AM.

  10. #10
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Quote Originally Posted by abk View Post

    Binary file is made up of 0 and 1, ASCII files are full of all ASCII characters.
    Everything on your hard disk is "made up of 0 and 1".

  11. #11
    Super unModrator
    Join Date
    Dec 2007
    Posts
    321
    what I meant to say is:

    If you are viewing a Binary file on your monitor, it will look like this:

    001111000101010111100110
    011101101011010101010101
    101110101010101010101011
    But ASCII file will look like this :
    This is an ASCII file

  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    More nonsense. If I view an ASCII file it looks like this:
    Code:
    0000000 074543 064554 062156 064562 004570 026411 020076 067556
    0000020 062553 073571 071157 005144 064556 064147 064164 073541
    0000040 004553 026411 020076 067556 062553 073571 071157 005144
    0000060 071164 061541 061153 066141 071554 004411 037055 067040
    0000100 065557 074545 067567 062162 005012 060542 061162 071141
    0000120 060551 026556 064542 004556 026411 020076 071142 072165
    0000140 066141 060555 065563 062145 061012 061165 067055 061055
    0000160 067562 004563 026411 020076 067556 062553 073571 071157
    0000200 005144 067555 063541 004547 004411 037055 067040 065557
    0000220 074545 067567 062162 070012 071160 061541 071145 070012
    0000240 061571 062141 060551 071412 061555 067554 062556 071412
    0000260 070165 071145 072564 005170 072564 070170 061565 005153
    0000300 072564 071170 061541 071145 074012 060547 060554 060547
    0000320 005012 061541 005145 067147 061557 072141 067141 066412
    0000340 064141 067552 063556 031547 005144 074560 067563 005154
    0000360 026562 060553 071164 005157 063170 062562 061545 066145
    0000400 005154 066570 064141 067552 063556 005147 066570 066151
    0000420 062554 074012 061563 060562 061142 062554 005012 062547
    0000440 062556 060562 067564 005162 067151 067546 062556 005163
    0000460 073153 071551 060565 061154 074557 062141 060566 061556
    0000500 005145 072555 062560 033156 020064 005053 067163 071545
    0000520 074071 073012 071551 060565 061154 074557 062141 060566
    0000540 061556 005145 060571 060542 071565 005145 071412 072543
    0000560 066555 066566 025440 005012 072561 065541 030545 066455
    0000600 073157 062551 005163 074012 062560 063556 064565 071556
    0000620 005012 071141 067562 071567 060412 067564 064555 005170
    0000640 071144 062157 061055 067151 062412 064556 066547 005141
    0000660 064546 064163 063055 066151 062554 071564 063012 067554
    0000700 067542 072560 067571 063412 066545 071144 070157 005170
    0000720 062547 064155 067165 063412 062562 062145 005171 061551
    0000740 061145 062562 065541 071145 063412 062567 062554 005144
    0000760 067550 026550 064542 005156 064553 064553 065412 074562
    0001000 072163 066141 071144 070157 066012 060555 061162 062554
    0001020 005163 062556 062566 061162 066141 005154 060560 064164
    0001040 066157 063557 061551 066141 070012 067151 072547 005163
    0001060 067564 063556 074012 067542 061155 005012 073556 005156
    0001100 073556 026556 062543 005160 072564 057570 070541 064146
    0001120 005012 067543 062562 060567 071562 071412 067564 062556
    0001140 026544 064542 005156 061563 071157 064143 062145 062063
    0001160 072012 064562 066160 060545 072412 067546 060455 005151
    0001200 062567 067163 072157 005150 067567 066562 074165 000012
    If I view a binary file, it might look like this:
    http://stud3.tuwien.ac.at/~e0226430/graphics/header.jpg

    A file depends entirely on interpretation.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    How about you doing some book work, then posting what YOU think is the answer to each question.
    Then we'll correct and inform as usual.

    Giving you a bunch of easy answers doesn't do anyone any favours.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C programming exercises, exam notes, questions...etc
    By BlackOps in forum C Programming
    Replies: 0
    Last Post: 07-11-2009, 08:54 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 08:39 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM