1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Rzqust [24]
4 years ago
12

If the derived class classD overrides a public member function functionName of the base class classB, then to specify a call to

that public member function of the base class, you use the statement __________.a. classD::functionName();b. classB::functionName();c. classD.functionName();d. classB.functionName();
Computers and Technology
1 answer:
olga nikolaevna [1]4 years ago
7 0

Answer:

Option (d)

Explanation:

More specifically class B's object name will be there which would be

obj.funcname();

where obj is object of class B. If we need to call overridden method of class D then object of class D should be made. For example :

#include <iostream>

using namespace std;

class B

{

   public:

   void print()

   {

       cout<<"class B";

   }

};

class D : public B

{

   public:

   void print()

   {

       cout<<"class D";

   }

};

int main()

{

   B obj;

   obj.print();  //option d

   return 0;

}

Options a and b are wrong as it is no way of calling a class's method and option c would call the overridden method of derived class.

You might be interested in
Into which of these files would you paste copied information to create an integrated document? A. Mailing list B. Source C. Data
viva [34]

it would be b.mailing list


5 0
3 years ago
Read 2 more answers
What is shouting pertaining to the internet
Ludmilka [50]
Hi!

What is considered shouting on the internet is when WHEN YOU TYPE IN ALL CAPS LIKE THIS!!! Doing this seems to make the words appear louder and more prominent. You can also add more emphasis to ALL CAP words by adding ***ASTERISKS***.
8 0
3 years ago
Package Newton’s method for approximating square roots (Case Study 3.6) in a function named newton. This function expects the in
notka56 [123]

Answer:

import math

#Initialize tolerance

tolerance = 0.000001

def newton(x):

   """ Returns the square root of x """

   #Performs the successive approximations

   estimate = 1.0

   while True:

       estimate = (estimate + x / estimate) / 2

       difference = abs(x - estimate ** 2)

       if difference <= tolerance:     # Break out of loop if difference is less than tolerance

           break            

       return estimate     # While the difference value is > TOLERANCE, the process continues

def main():

   """Allows the user to obtain square roots."""

   while True:

       #Receive the input number from the user

       x = input("Enter a positive number or enter/return to quit: ")

       if x == "":     #if user presses "Enter" then exit the program

           break       # Otherwise, continue the process of allowing new numbers

       x = float(x)

       #Output the result

       print("The programs estimate of the square root of ", x, "is ", round(newton(x),2))

       print("Python's estimate: ", math.sqrt(x))

main()

8 0
3 years ago
What is a URL (Please explain)?
GalinKa [24]
Definition

URL a.k.a uniform resource locater, is simply the address of a World Wide Webpage.

Sentence example:

"Type a URL into a browser's address bar."
5 0
3 years ago
Which of the following statements is NOT correct?
Ainat [17]

Answer: B)  Pseudocode should be properly formatted.

Explanation:

 Pseudocode is defined as in the informal description of the given sequence, there is no need that it should be formatted properly. There is no such restriction required in the pseudocode as they are read by the humans not by the computer programs.

Pseudocode should be terminating, executable and unambiguous and it uses structural convention of the programming language rather than using machine reading.

4 0
3 years ago
Other questions:
  • Problem 2 (40 points)-Write a program. Submit a file named weight.cpp Create a program that continuously allows a user to enter
    5·1 answer
  • Which computer applications can Mr. Crowell use to make the classroom learning more stimulating and interesting? Mr. Crowell has
    9·2 answers
  • Instructions Write a program that asks the user for a number. If the number is between 1 and 255, the program outputs the corres
    15·1 answer
  • Andrew has data in cell E14 and the cell should be blank. Andrew should _____.
    15·2 answers
  • Which of the following are the dimensions of feasibility? Group of answer choices cost, schedule, technical, and organizational
    14·1 answer
  • Vannevar Bush imagined a desktop computing machine that would allow people to access data stored in various information centers
    13·1 answer
  • The bubble sort algorithm sorts using what technique?
    14·1 answer
  • An article explaining the uses of the parts of a computer​
    14·1 answer
  • Identify similarities and differences of hibiscus leaves <br>​
    14·1 answer
  • Naynar kis dhrm se sambandhit hai​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!