The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 305 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
NEED ANSWER TO THESE QUESTIONS ASAP..THANK YOU
Â
1- A destructor, unlike any other normal function, (Points : 3)
      has no return type and must begin with ~.
Â
      can be automatically called, without code showing it.
Â
      cannot have parameters.
Â
      All of the above
Â
2. Variable data in a class is never called a(n) _____ by programmers. (Points : 3)
      member variable
Â
      attribute
Â
      field
Â
      behavior
Â
Question 3. 3. When accessing class members, the member operator is used. The member operator is the following punctuation. (Points : 3) <..>
Â
11. The following can be used to determine the number of elements in a statically allocated array in C or C++. (Points : 3)
      sizeof(arrayname)/sizeof(arrayname[0])
Â
      elementsof<arrayname>
Â
      arrayname.length()
Â
      None of the above
Â
Question 12. 12. Passing by reference and by pointer are very similar, except that (Points : 3)
      NULL cannot be passed by reference.
Â
      when passing objects by reference, . is used; by pointer, -> is used.
Â
      variables passed by pointer must be dereferenced and passed using an address.
Â
      All of the above
Â
Question 13. 13. Overloaded operators (Points : 3)
      should always be used to replace functions with long names.
Â
      are encouraged to be used creatively by professional programmers.
Â
      are widely supported by most computer languages.
Â
      None of the above
Â
Question 14. 14. Every object can use a copy constructor whether or not one is defined. The default copy constructor performs (Points : 3)
      nothing; the default copy constructor must be overwritten to function correctly.
Â
      a shallow copy, which will only copy variable and pointer values and ignore allocated memory.
Â
      a deep copy, which will correctly duplicate allocated memory.
Â
      is rarely used by programmers because of how error prone it is, especially for very small (in bytes) types.
Â
Question 15. 15. A constructor is called automatically whenever (Points : 3)
      an argument is passed by value.
Â
      an object is created without parameters.
Â
      a function returns an object by value.
Â
      All of the above
Â
Question 16. 16. A child class does not inherit _____ from a super class. (Points : 3)
      constructors
Â
      access to private members
Â
      functions that have been overloaded
Â
      All of the above
Â
Question 17. 17. When a parent class is typecast to a child, this is called (Points : 3)
      evolution.
Â
      reheritance.
Â
      downcasting.
Â
      All of the above
Â
Question 18. 18. Typecasting a pointer of type Foo into a pointer of type Bar (Points : 3)
      is possible and might be useful, especially if types are related and especially in pure C programming.
Â
      can result in undefined behavior when accessing memory because of different memory structure in Foo and Bar.
Â
      can allow reading raw data from memory without typcasting Foo to type Bar.
Â
      All of the above
Â
Question 19. 19. If unsure whether to use inheritance or composition, use (Points : 3)
      inheritance, because it saves the most typing.
Â
      inheritance, because C++ supports multiple inheritance.
Â
      composition, because it gives programmers the most options.
Â
      composition, because it is more efficient than inheritance.
Â
Question 20. 20. When creating a header file and a separate .cpp file, good design dictates that the header file should have as few _____ as possible (these should be in the .cpp instead). (Points : 3)
      library dependencies
Â
      block comments
Â
      characters in the filename
Â
      All of the above
Â
Question 21. 21. Consider testing if a C++ pointer named objPtr points to an object of type Type. The syntax used to determine that would be as follows. (Points : 3)
      if( objPtr instanceof(Type) )
Â
      if( dynamic_cast<Type>(objPtr) )
Â
      if( size-of[objPtr,Type] )
Â
      if( try(objPtr)<Type> )
Â
Question 22. 22. When referencing an element from a two-dimensional array, it is best to access elements in _____ order. (Points : 3)
      first-in-first-out
Â
      last-in-first-out
Â
      row/col
Â
      x/y
Â
Question 23. 23. Heap memory is where (Points : 3)
      global variables and raw machine code are stored.
Â
      local variables and execution of instructions are kept track of.
Â
      dynamic memory is allocated to.
Â
      None of the above
Â
Question 24. 24. An abstract base class (also called an Interface) (Points : 3)
      must have a pure virtual function.
Â
      cannot be instantiated.
Â
      allows polymorphism of all inheriting types.
Â
      All of the above
Â
Question 25. 25. Virtual functions have a cost when compared to normal (statically bound) functions; specifically, they are (Points : 3)
      slower and less optimizable.
Â
      less dynamic.
Â
      unusable with polymorphism.
Â
      more difficult to read than extern or static functions.
Â
Question 26. 26. Assert statements align with the fail-fast programming philosophy because they (Points : 3)
      crash the program as soon as any error is detected.
Â
      silently mark when and where an error occurred.
Â
      prevent errors by automatically testing code.
Â
      allow the compiler to accept errors as warnings.
Â
Question 27. 27. Preprocessor macros (Points : 3)
      should be avoided if other language features will work just as well.
Â
      can easily confuse other programmers not familiar with your macro.
Â
      should be undefined after use to avoid polluting the global namespace.
Â
      All of the above
Â
Question 28. 28. Which piece of the C/C++ compile tool chain inserts header files into compilation units? (Points : 3)
      Preprocessor
Â
      Compiler
Â
      Linker
Â
      Debugger
Â
Question 29. 29. C++ exceptions are better than C error codes because C++ exceptions (Points : 3)
      maintain stack information to find exactly where errors happened.
Â
      easily handle partial-initialization with try/catch blocks.
Â
      are always much faster and more efficient than C error codes.
Â
      C++ exceptions are not better; they are just another way of handling errors.
Â
Question 30. 30. A function template allows a function to be (Points : 3)
      executed more safely than normal.
Â
      executed more quickly than normal.
Â
      called with many different types.
Â
      All of the above
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly