Python Forum
Just some second choice answers help please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Just some second choice answers help please
#1
Forget my uni assignment was in for today :/


1.      What could we do to better encapsulate our classes?
A.     Use Getters and Setters.
B.     Use fewer methods.
C.     Allow free access to the instance variables.
D.     Give descriptive variable names.
 
Answer:
 
2.      Which of the following statement is correct?
A.     Class is an instance of object.
B.     Object is an instance of a class.
C.     Class is an instance of data type.
D.     Object is a description of a class.      
 
3.      What method is called when instantiating an object?
A.     The Destructor.
B.     The Constructor.
C.     The Getter.
D.     The Setter.
 
4.      Which of the following concepts means wrapping up of data and functions together?
A.     Abstraction
B.     Encapsulation
C.     Inheritance
D.     Polymorphism
 
 
 
5.      What does the double underscore denote in at the beginning of a method?
A.     The method is Private
B.     The method is Public
C.     The method is a Friend
D.     The method is Protected


6.      In UML what is character used to denote a public variable?
A.     
B.     +
C.     /
D.     P
 
7.      What goes at the top of a UML class diagram?
A.     The constructor
B.     The methods
C.     The variables
D.     The name of the class
 
8.      What do we call it when we create a new class that is based on an existing class?
A.     Polymorphism.
B.     Inheritance.
C.     Overloading.
D.     Overriding.
Reply
#2
(Apr-06-2017, 01:26 PM)ajaY Wrote: Forget my uni assignment was in for today :/

Sorry to hear that...
Still you have time to research the correct answers yourself.
Reply
#3
bump pls
Reply
#4
There are people coming from Java/C++ that that has made these questions Snooty
Reply
#5
(Apr-06-2017, 01:40 PM)ajaY Wrote: bump pls
We're not going to answer your questions. If you make an attempt and explain your reasoning, someone might come along and help. But you're very unlikely to get satisfactory answers if you haven't made a clean effort.
Reply
#6
1) None of the answers are appropriate.  All of those answers assume private/protected/public accessors, which don't exist in python.
2-the rest) These are simple definitions, which can easily be looked up.
Reply
#7
(Apr-07-2017, 05:34 PM)nilamo Wrote: 1) None of the answers are appropriate.
Well, one of them makes more sense than the others, especially if you forgive the poorly-worded question (it's not the classes you want to encapsulate, the classes are the tool for doing the encapsulation).

(Apr-07-2017, 05:34 PM)nilamo Wrote: All of those answers assume private/protected/public accessors, which don't exist in python.
Sure, but you could (try) to use it as a comparison of Python vs. C++. Though there's more nuance to it than the multi-choice suggests.

(Apr-07-2017, 05:34 PM)nilamo Wrote: 2-the rest) These are simple definitions, which can easily be looked up.
(EDIT: This is the first time I've been bit by unicode stuff on this site; I tried to do a thumbs up.)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Why do these codes give different answers? pooyan89 5 2,418 Dec-15-2020, 06:54 PM
Last Post: DeaD_EyE
  Using random.choice v.v Dawkinz 8 3,423 Aug-31-2019, 04:42 PM
Last Post: Dawkinz
  help setting questions and answers in quiz game? yoyoitsjess 3 3,612 May-10-2018, 07:35 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020