What output does the following code generate? Why?
What output does it generate if you make A::Foo() a pure virtual function?
class A {
A() { this->Foo(); }
virtual void Foo() { cout << "A::Foo()" << endl; }
};
class B : public A {
B() { this->Foo(); }
virtual void Foo() { cout << "A::Foo()" << endl; }
};
int main(int, char**)
{
A objectA;
B objectB;
return 0;
}
No Answer is Posted For this Question
Be the First to Post Answer
Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and with complexity T(n) is at most about (1.5)n comparisons.
10 Answers ABC, College School Exams Tests, ITC Infotech, Kyambogo University, Qatar University,
what is the use of using for loop as "for(;;)"?
What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
0 Answers Jomo Kenyatta University,
Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.
How can I Draw an ellipse in 3d space and color it by using graph3d?
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
1.program to add any two objects using operator overloading 2.program to add any two objects using constructors 3.program to add any two objects using binary operator 4.program to add any two objects using unary operator
Code for Easily Using Hash Table?
void main() { int i,j=2; for(i=0;i<3;i++) if(j=i) cout<<"Lotus "; else cout<<"Rose "; } Its result is Rose Lotus Lotus.. How? Explain it?
Write a simple encryption program using string function which apply the substitution method.
PROBLEM #8 The cashier at the counter of a Super Store, Mr. Khazaanchi has the following bundles of rupee cash notes with him: Rs. 1, 2, 5, 10, 50, 100, 500, 1000 A customer comes at his counter with various items that he has shopped. Mr. Khazaanchi totals the item prices and tells the customer his total amount payable. The customer gives Mr. Khazanchi some amount of cash. Find the total number of rupee notes of each denomination (i.e. 1, 2, 5, 10, 50, 100, 500, 1000) Mr. Khazaanchi will have to give to the withdrawer ensuring that the total number of rupee notes are minimum.