Explain what is the order of the calls to the constructor

Assignment Help Computer Engineering
Reference no: EM13771951

1. Are the following statements correct? Why?

char* s = "hello";

s = "how are you?";

2. Are the following statements correct? Why?

char s[] = "Greetings";

s = "Greetings";

3. Are the following statements valid? Why?

float f = 10.0;

const float *pf = &f;

f++;

(*pf)++;

4. Are the following statements valid? Why?

const int m =200;

const int * q = &m;

++(*q);

++q;

5. Is the following declaration valid? Why?

char str[8] = "COP 2931";

6. Given the following class inheritance structure, what is the order of the calls to the constructor if an object of class derived2 is declared?

Class base {}

class derived1: public base {}

Class derived2: private derived1 {}

7. In the following code segment, indicate whether the access in the two statements in boldface is valid or not and why.

class Setter{

private:

char *myName;

public:

friend void info(Setter, Name);

};

class Name: private Setter {

private:

char *myAddress;

};

void info(Setter s, Name n) {

cout << s.myName << endl;

cout << n.myAddress << endl;

};

8. In the following code segment, indicate whether the access in the statements in boldface is valid or not and why.

class Name {

protected:

char* myName;

};

class Contact: public Name {

private:

char* myAddress;

};

class employee: public Contact {

public:

void print(void) {

cout << myName << endl;

cout << myAddress << endl;

}

}

Reference no: EM13771951

Questions Cloud

Obtaining capital from a foreign source : Prepare a report on the different considerations that an MNC should keep in mind when obtaining capital from a foreign source. In this report, you must outline and evaluate two possible methods for determining cost of capital.
Think about the information on the different crimes : You will write a report in which you present your recommendations to the president. Consult your textbook index for a list of crime types. Think about the information on the different crimes and select one crime that you believe is the most diffic..
Which molecules has a non-zero dipole moment : According to the VSEPR theory, the molecular geometry of ammonia is and which molecules has a non-zero dipole moment
Comparative statistics for the most populated countries : Choose a Region and construct a few tables and a few graphs showing comparative statistics for the 4 most populated countries in your Asia based on the indexes:
Explain what is the order of the calls to the constructor : Given the following class inheritance structure, what is the order of the calls to the constructor if an object of class derived 2 is declared
Describe in detail the budgets : Budgets are the driving force behind all organizations. Whether a manufacturing organization, or a service organization such as a medical or public accounting firm, budgets are used not only for planning purposes, but also used for performance mon..
The existence of carbon based molecules in meteorites : What is meant by a radiationi dominated universe? Matter dominated universe?
Create an application to calculate sales persons salary : a salesperson who grosses $5000 in sales in a week receives $150 plus 10% of $5000, a total of $650. Write an application that calculate each sales person's total salary per week.
Discuss the movement of teams in baseball : In a minimum of 250 words in your initial post discuss the movement of teams in baseball. What teams left to other cities? Why did they do this

Reviews

Write a Review

Computer Engineering Questions & Answers

  By using a personal computer as a base model write a c

using a personal computer as a base model write a c syntactically correct class definition demonstrating composition.

  Questiontwo stacks of positive integers are required both

questiontwo stacks of positive integers are required both containing integers with values less than or equal to 1000.

  What are all of ip addresses

What are all of IP addresses

  What is included in the establishment of a functional

part 1 using the internet search for commercial idps systems. what classification systems and descriptions are used and

  Create program that reads from the external file input.txt

create a program that reads from the external file input.txt

  Determine the costs of this massive expansion of

business intelligence knowledge management and expert systems are powerful tools that allow corporations to analyze

  How can we prepare to meet the challenges of that future500

what will the future hold for those in the information technology field?how can we prepare to meet the challenges of

  Calculate the output value of problem

Design a program that reads in a text file with drawing commands and then outputs a bitmap with all the items drawn correctly

  How various faults does windows xp have

Research shows that there are about 5 faults per 1000 lines of code in carefully made programs, that means that 1 million lines of codes will have 5000 faults. Windows XP has approximately 45 million lines of code.

  1 write a script to help users calculate compressed file

1. write a script to help users calculate compressed file size. prompt the user to enter the original size of a file

  Make the price of an item for each of the five days

The Last Stop Boutique is having a five-day sale. Each day, starting on Monday, price will drop 10% of the previous day's price. For example, if the original price of a product is $20.00, the sale price on Monday would be $18.00 (10% less than the..

  Sense making in health care organizations

Evaluate the most suitable way that the “sense making” may be applied to the health care organizations. Give the specific examples in order to support your response.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd