Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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;

}

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91341711
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Computer Engineering

Up and down a stringcreate a program called

Up and Down a string Create a program called lastnomeupAndDown take a string input from the user and print out that will substrings of increasing length next to each other until the word is fully printed, then repeat the ...

Calculate the price of a five-year bond that has a coupon

Calculate the price of a five-year bond that has a coupon rate of 6.5 percent paid annually. The current market rate is 5.70 percent. (Round answer to 2 decimal places, e.g. 5,275.25.)

Explain data information and knowledge with examples make

Explain data, information, and knowledge with examples. Make sure to clearly identify the differences between the terms.

Prove the sieve of eratosthenes algorithm has runtime

Prove the Sieve of Eratosthenes algorithm has runtime complexity ≤ O(n log log n). Sieve Input: an integer n > 1. Let A be an array of Boolean values, indexed by integers 2 to n, initially all set to true. for i = 2,3,4, ...

Please tell me about planning and installing a wireless

Please tell me about Planning and Installing a Wireless Network

Question suppose that a computer can execute 1 billion

Question : Suppose that a computer can execute 1 billion instructions/sec and that a system call takes 1000 instructions, including the trap and all the context switching. How many system calls can the computer execute p ...

Question complete the lab 5-5 programming challenge 1 - yum

Question: Complete the Lab 5-5, "Programming Challenge 1 - Yum Yum Burger Joint," of Starting Out with Programming Logic and Design. Note: You are only required to create the flowchart for this activity; however, notice ...

With respect to the needham-schroeder 0v0ap authentication

With respect to the Needham-Schroeder (0V0AP) authentication protocol, assume that a client (point A in the 0V0AP description) is holding the wrong key Describe in PRECISE terms (in terms of the contents of the packets t ...

What would be examples of valid selection methods used by

What would be examples of valid selection methods used by the human resource department to ensure selecting the appropriate candidate for a job.

Compare remote authentication dial-in user service radius

Compare Remote Authentication Dial-In User Service (RADIUS) and Terminal Access Controller Access-Control System Plus (TACACS+).

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As