Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Question 1

 

All methods in an interface must be abstract methods.

A. True
B. False

 

Question 2

 

All methods in an abstract class must be declared as abstract methods.

A. True

B. False

 

Question 3

 

PHP does not allow multiple inheritance.

A. True

B. False

 

Question 4

 

PHP does not allow constructor overriding.

A. True

B. False

 

Question 5

 

Given a class named Person:

class Person {

private $name;

public function __construct($name) {

$this->name = $name;

}

}

Which of the following creates an object from the Person class?

A. $judy = new Person();

B. $aPerson = new Person("judy");

C. $p = Person(); $p->setName("judy");

D. $p = __construct("judy");

 

Question 6

 

Which of the following is NOT true regarding a PHP class constructor?

A. A constructor is called whenever a new instance is created.

B. A constructor can not accept any parameter.

C. A constructor is always named __construct.

D. A constructor could inherit code from a parent class.

 

Question 7

 

Which of the following creates a default constructor for the class called Animal?

A. public function __construct() { }

B. public function Animal() { }

C. public function __construct($name) { }

D. public function __Animal() { }

Question 8

 

In OOP, class data are usually private so access to class data is restricted. This design practice is called _______.

A. data composition

B. data hiding

C. data restriction

D. data abstraction

 

Question 9

 

The template or blueprint that defines abstract characteristics of all real world objects of the same kind is called a(n) ______ in OOP.

A. object

B. constructor

C. class

D. function

 

Question 10

 

In OOP, the practice of deriving new classes from existing classes is called __________.

A. inheritance

B. encapsulation

C. polymorphism

D. composition

 

Question 11

 

Which of the following statement is NOT true?

A. An abstract method contains no implementation.

B. A class that contains one or more abstract methods must be declared as "abstract".

C. An abstract class can't be instantiated.

D. A class that extends an abstract class can not be abstract.

 

Question 12

 

The public methods of a class are also known as the class's _____.

A. accessor

B. interface

C. implementation

D. constructor

Question 13

 

Given a class method named myMethod:

class A {

____ function myMethod {

//code omitted

}
}

If you don't want the method to be overridden, what keyword should be used in the blank?

A. final

B. static

C. private

D. abstract

Question 14

 

Given classes named Parent and Child:

class Parent {

public function aMethod($name) {

//code omitted

}

}

class Child extends Parent {

//insert a method here

}

Which of the following methods in class Child overrides the method aMethod defined in class Parent?

A. public function aMethod($a, $b) { //code omitted }

B. public function bMethod($name) { //code omitted }

C. public function aMethod($name) { //code omitted }

D. public function bMethod($a, $b) { //code omitted }

Question 15

 

Which of the following is NOT a valid PHP visibility modifier?

A. protected

B. private

C. friendly

D. public

Question 16

 

In OOP, composition is sometimes referred to as a(n) ______ relationship.

A. has-a

B. is-a

C. inheritance

D. interface

Question 17

 

A _____ variable represents classwide information that is shared by all the objects of the class.

A. public

B. final

C. abstract

D. static

Question 18

 

Given an OOP interface:

interface Shape {

public function getArea();

public function getName();

}

class A ______ Shape {

//code omitted

}

What should be inserted into the blank in class A?

A. implements

B. inherits

C. extends

D. overrides

Question 19

 

Given a class named Person:

class Person {

private $name;

private static $count;

public function __construct($theName) {

______ = $theName;

//other code omitted

}

}

What should be inserted into the blank?

A. $name

B. $self->name

C. $this->name

D. $this->$name

Question 20

 

Given a class named Person:

class Person {

private $name;

private static $count;

public function __construct($name) {

_________

//other code omitted

}

}

What should be inserted into the blank so that the variable $count increments by 1 everytime a Person object is created?

A. $count++;

B. $this->count++;

C. $self->count++;

D. self::$count++;

Question 21

 

A is-a relationship is implemented via __________.

A. interface

B. inheritance

C. polymorphism

D. encapsulation

Question 22

 

Polymorphism is one of the three major OOP principles. It means ______________.

A. that a class can contain another class.

B. that data fields should be declared private.

C. that a class can extend another class.

D. that a variable of supertype (e.g. animal) can act as a subtype object (e.g. cat or dog). Therefore, a method operating on a supertype can operate on a subtype properly.

Question 23

 

Composition means ______________.

A. that a class can contain another class.

B. that data fields should be declared private.

C. that a class can extend another class.

D. that a class can implement another interface.

Question 24

3.0 Points

In a UML class diagram, the symbol "+" or "-" before a member name specifies accessibility of the member. "-" indicates that the member is .

Question 25

 

In OOP, _________ can be used to provide functionality to be inherited by related or unrelated classes.

A. superclass

B. inhiertiance

C. interface

D. polymorphism

Question 26

 

Which of the following statements is true?

A. A final class can have instances.

B. A final class can be extended.

C. A final class can be abstract.

D. A final class can not be a child class of another class.

Question 27

 

What keyword can be used to reference a method defined in the superclass from a subclass?

A. super

B. this

C. parent

D. self

Question 28

In an UML class diagram, inheritance relationship between a parent class and its child class is graphically shown with the arrow pointing to the class.

Question 29

Given a class diagram below:

https://a.gfx.ms/i_safe.gif

Note: the three circles and the numbers next to them are not part of the class diagram.

Object oriented programming supports three types of class relationship:composition, inheritance, and interface. Identify the three types of class relationship in the above diagram. The symbol in Circle 1 indicates relationship; the symbol in Circle 2 indicates relationship; and the symbol in Circle 3 indicates relationship.

Question 30

People often refer to an object in OOP programing as a black box. Explain your understanding of this analogy.

(Maximum number of characters: 60000)

Show/Hide Rich-Text Editor

Question 31

Given a JavaScript function named search:

function search() { //code omitted }

The following is the HTML code for a textbox:



The event handler for handling key release is onkeyup. What code should be filled in the blank above so that when a key is released in the textbox, the search function will be invoked?

Question 32

 

Given an XML document segment:

2011

The type of the node that contains the string value "2011" is ______.

A. Document node

B. Element node

C. Text node

D. Attribute node

Question 33

 

This question refers to an XML document named book.xml. Click here to display the document.

Given a JavaScript variable named xmlDoc which refers to the XML document book.xml. Which of the following answers can you use to retrieve the the author of the second book, whose id is "bk102"?

A. xmlDoc.getElementsByTagName("author")[1].firstChild.nodeValue;

B. xmlDoc.getElementById("author")[2].firstChild.nodeValue;

C. xmlDoc.getElementsById("author").firstChild.data;

D. xmlDoc.getElementsByTagName("author")[1].nodeValue;

Question 34

 

One way a web server responds to an asynchronous AJAX request is sending an XML document back to the client. To extract the XML document, you may use the ________ property of the XMLHttpRequest object. .

A. value

B. responseText

C. responseXML

D. xmlDoc

Question 35

 

Given an XMLHttpRequest object named xmlHttp. Which of the following is the correct code for defining an asynchronous AJAX request?

A. xmlHttp.open("POST", "guess.php?guess=" + guess, true);

B. xmlHttp.open("POST", "guess.php?guess=" + guess, false);

C. xmlHttp.open("GET", "guess.php?guess=" + guess, true);

D. xmlHttp.open("GET", "guess.php?guess=" + guess, false);

Question 36

The readyState property of the XMLHttpRequest object indicates the current state of the object. The event handler that can be used to monitor status changes of the object is

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91346338
  • Price:- $50

Guranteed 36 Hours Delivery, In Price:- $50

Have any Question?


Related Questions in Programming Language

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As