Oriented Programming (1 of 3)
Questions with Accurate Answers
How are data and algorithms treated in the object-oriented view?
correct answer They are bundled together within each object
How do interpreters handle program execution? correct answer They
translate and execute statements one at a time
How do objects in a program interact with one another? correct answer
By sending messages or invoking subprograms
How do you query a fact in Prolog? correct answer Using a question
mark followed by the query
How does a class fulfill its behavior responsibilities in object-oriented
design? correct answer By executing tasks using its encapsulated data
How does a compiler differ from an interpreter? correct answer A
compiler translates high-level code into machine code for separate
execution
How does a student class calculate its GPA in an object-oriented
design? correct answer By using encapsulated data within the class to
perform the calculation
, How does Java achieve portability? correct answer By translating
programs into Bytecode for execution by the JVM
How does Prolog define relationships between objects? correct answer
Using facts and rules
How does the object-oriented paradigm differ from the procedural
paradigm? correct answer It bundles objects with their manipulating
code
How is a top-down design different from an object-oriented design?
correct answer Top-down focuses on tasks, while object-oriented
focuses on objects
How is repetition handled in the functional paradigm? correct answer
Through recursive function calls
In object-oriented programming, what is a class? correct answer A
blueprint describing the properties and behaviors of objects
In Prolog, what does a variable begin with? correct answer An
uppercase letter
In Scheme, what does the expression (* 3 4) return? correct answer 12