Question

In: Civil Engineering

Overloading the insertion (<<) and extraction (>>) operators for class use requires creating operator functions that...

Overloading the insertion (<<) and extraction (>>) operators for class use requires creating operator functions that use these symbols but have a parameter list that includes a class ____.

object

address

reference

data type

Flag this Question

Question 210 pts

When overloading the insertion operator to process a Complex object, it’s important to understand that you’re overloading an operator in the ____ class.

istream

operator

Complex

ostream

Flag this Question

Question 310 pts

____ class variables are allocated memory locations independent of any object being instantiated.

Register

Static

Extern

Global

Flag this Question

Question 410 pts

Static member ____ can only access static data members and other static member ____ of the class.

references, variables

functions, functions

objects, variables

variables, functions

Flag this Question

Question 510 pts

A nonmember function can access private class data members as a(n) ____.

operator

friend

privileged function

static function

Flag this Question

Question 610 pts

Conversion from a built-in type to a class type is made using a(n) ____ constructor.

object conversion

type conversion

copy

type exchange

Flag this Question

Question 710 pts

____ is the capability of deriving one class from another class.

Polymorphism

Overloading

Inheritance

Redefinition

Flag this Question

Question 810 pts

Overriding a base member function by using an overloaded derived member function is an example of ____.

scoping

inheritance

polymorphism

derivation

Flag this Question

Question 910 pts

If a base class member has a protected access and the derived class’s access specifier is public, the derived class member is ____ to its class.

global

public

protected

private

Flag this Question

Question 1010 pts

When a derived class object is assigned to a base class object, only the set of all the ____ class data members is assigned.

derived

private

base

instantiated

Solutions

Expert Solution

All answers are in bold word

1)Overloading the insertion (<<) and extraction (>>) operators for class use requires creating operator functions that use these symbols but have a parameter list that includes a class Object.

2)When overloading the insertion operator to process a Complex object, it’s important to understand that you’re overloading an operator in the Istream class.

3)Global class variables are allocated memory locations independent of any object being instantiated.

4)Static member Functions can only access static data members and other static member Variables of the class.

5)A nonmember function can access private class data members as a(n) Friend.

6)Conversion from a built-in type to a class type is made using a(n) type conversion constructor.

7)Inheritance is the capability of deriving one class from another class.

8)Overriding a base member function by using an overloaded derived member function is an example of inheritance.

9)If a base class member has a protected access and the derived class’s access specifier is public, the derived class member is Protected to its class.

10)When a derived class object is assigned to a base class object, only the set of all the base class data members is assigned.


Related Solutions

C++ Programming 19.2 Operator Overloading practice Write the prototypes and functions to overload the given operators...
C++ Programming 19.2 Operator Overloading practice Write the prototypes and functions to overload the given operators in the code main.cpp //This program shows how to use the class rectangleType. #include <iostream> #include "rectangleType.h" using namespace std; int main() { rectangleType rectangle1(23, 45); //Line 1 rectangleType rectangle2(12, 10); //Line 2 rectangleType rectangle3; //Line 3 rectangleType rectangle4; //Line 4 cout << "Line 5: rectangle1: "; //Line 5 rectangle1.print(); //Line 6 cout << endl; //Line 7 cout << "Line 8: rectangle2: "; //Line...
c++ using class... define operator overloading and give simple example how we can use operator overloading...
c++ using class... define operator overloading and give simple example how we can use operator overloading by writing simple program in which different operators are used to add, subtract, multiply and division.
Wondering where to start on this C++ homework assignment involving friend functions and overloading operators implemented...
Wondering where to start on this C++ homework assignment involving friend functions and overloading operators implemented in a Rational class. These are the instructions: Your class will need to store two internal, integer values for each Rational number, the numerator (top) and denominator (bottom) of the fraction. It will have three constructor functions, with zero, one and two arguments, used as follows:     Rational test1, test2(10), test3(1, 2); The declaration for test1 calls the default (no argument) constructor, which should...
Lab Assignment Objectives 'Be able to overload combined binary operators as member operator functions. Show how...
Lab Assignment Objectives 'Be able to overload combined binary operators as member operator functions. Show how to overload binary operators as friend functions. Show how to convert from a fundamental type to a user-defined type using a constructor. Understand exception handling mechanisms using try-catch block statements. Understand the Application Complex Numbers A complex number, c, is an ordered pair of real numbers (doubles). For example, for any two real numbers, s and t, we can form the complex number: This...
Lab Assignment Objectives 'Be able to overload combined binary operators as member operator functions. Show how...
Lab Assignment Objectives 'Be able to overload combined binary operators as member operator functions. Show how to overload binary operators as friend functions. Show how to convert from a fundamental type to a user-defined type using a constructor. Understand exception handling mechanisms using try-catch block statements. Understand the Application Complex Numbers A complex number, c, is an ordered pair of real numbers (doubles). For example, for any two real numbers, s and t, we can form the complex number: This...
language is java Use method overloading to code an operation class called CircularComputing in which there...
language is java Use method overloading to code an operation class called CircularComputing in which there are 3 overloaded methods as follows: computeObject(double radius)-compute area of a circle computeObject(double radius, double height)-compute area of a cylinder computeObject(double radiusOutside, double radiusInside, double height)-compute volume of a cylindrical object These overloaded methods must have a return of computing result in each Then override toString() method so it will return the object name, the field data, and computing result Code a driver class...
Write the following questions as queries in SQL. Use only the operators discussed in class (no...
Write the following questions as queries in SQL. Use only the operators discussed in class (no outer joins) Consider the following database schema: INGREDIENT(ingredient-id,name,price-ounce) RECIPE(recipe-id,name,country,time) USES(rid,iid,quantity) where INGREDIENT lists ingredient information (id, name, and the price per ounce); RECIPE lists recipe information (id, name, country of origin, and time it takes to cook it); and USES tells us which ingredients (and how much of each) a recipe uses. The primary key of each table is underlined; rid is a foreign...
Write the following questions as queries in RELATIONAL ALGEBRA. Use only the operators discussed in class...
Write the following questions as queries in RELATIONAL ALGEBRA. Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). The following database schema is given: ATHLETE(name,age,height,weight,country) RACE(id,location,date,time-start,distance) COMPETES(aname,rid,time,position) where ATHLETE has information about runners (their name, age, height, weight, and nationality); RACE has information about races (id, location, date when it’s held, time it starts, and distance ran); and COMPETES keeps track of which runners run on with race, the time it...
Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference...
Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). Type your answers. The following database schema is given: ATHLETE(name,age,height,weight,country) RACE(id,location,date,time-start,distance) COMPETES(aname,rid,time,position) where ATHLETE has information about runners (their name, age, height, weight, and nationality); RACE has information about races (id, location, date when it’s held, time it starts, and distance ran); and COMPETES keeps track of which runners run on with race, the time it took them to complete the race,...
Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference...
Use only the operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference and renaming). Type your answers. Consider the following database schema: INGREDIENT(ingredient-id,name,price-ounce) RECIPE(recipe-id,name,country,time) USES(rid,iid,quantity) where INGREDIENT lists ingredient information (id, name, and the price per ounce); RECIPE lists recipe information (id, name, country of origin, and time it takes to cook it); and USES tells us which ingredients (and how much of each) a recipe uses. The primary key of each table is underlined; rid...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT