Answer:
2. <em>A reference of type A can be treated as a reference of type B</em> - False
Base class or its objects are not related to their derived class (or its objects).
Explanation:
class A {
int a;
public A() {
a = 7;
}
}
class B extends A {
int b;
public B() {
b = 8;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
1. <em>After the constructor for class B executes, the variable a will have the value 7 </em>- True.
When an object of a derived class is declared, the constructor of base class is called before the constructor of derived class (is called).
3. <em>Both variables a and b are instance variables </em>- True.
Classes can have instance, or member, variables and methods.
4.<em> After the constructor for class B executes, the variable b will have the value 8</em> - True.
When object of class B is declared, its constructor was called, which initialized variable b to 8.
Answer:
The program in C++ is as follows:
#include <iostream>
using namespace std;
int perimeter(int side1, int side2, int side3){
return side1+side2+side3;
}
struct Triangle {
int side1; int side2; int side3;
};
int main(void) {
int side1, side2, side3;
cout<<"Sides of the triangle: ";
cin>>side1>>side2>>side3;
struct Triangle T;
T.side1 = side1;
T.side2 = side2;
T.side3 = side3;
cout << "Perimeter: " << perimeter(T.side1,T.side2,T.side3) << endl;
return 0;
}
Explanation:
See attachment for complete code where comments are as explanation
Answer:
b. will be lower if consumers perceive mobile phones to be a necessity.
Explanation:
The price elasticity of demand is described as the percentage variation in the demanded quantity of service or goods divided by the change in the percentage of the price. And henceforth it describes the responsiveness of the demanded quantity to a price change. And now if the mobile phones are thought of as being the necessity then the price will increase as demand will increase, and hence the price elasticity of demand will be lower. And if there is an improvement in the production technology then the price will be lowered, and hence price elasticity of demand will be less as the change in the percentage of the price will be negative. And the exact definition of it as we have described above. Hence, b is correct options.
The answer is built-in dictionary.
Most Microsoft Word versions come with a built-in dictionary for standard grammar and spellings. These dictionaries are not comprehensive. Word also has an additional option to add a spelling error to the dictionary so that the next time you type that same error, it will not come up as a spelling error. In addition, Word can use multiple custom dictionaries that allows you to supplement with the main dictionary and check the spelling of your documents.