Express the definition of function print of the class two

Assignment Help Computer Engineering
Reference no: EM1332033

What is wrong with the following code?

class classA
{
protected:
void setx(int a);
//Postcondition: x = a
private:
int x;
};
.
.
.
int main()
{
classA aObject;

aObject.setx(4);
return 0;
}

Consider the following code:

class one
{
public:
void print() const;
//Outputs the values of x and y.
protected:
void setData(int u, int v);
//Postcondition: x = u; y = v
private:
int x;
int y;
};

class two: public one
{
public:
void setData(int a, int b, int c);
//Postcondition: x = a; y = b; z = c
void print() const;
//Outputs the values of x, y, and z.
private:
int z;
};

a. Write the definition of the function setData of the class two.
b. Write the definition of the function print of the class two.

Reference no: EM1332033

Questions Cloud

Value of understanding job analysis information : Value of understanding job analysis information - What is the value of understanding job analysis information as an operating manager?
Generate a class named realtorcommission : generate a class named RealtorCommission. Fields include the sale price of a house, the sales commission rate, and the commission. Create two constructors.
Types of employee separation : Explain how different employment laws affect human resource practices and What are the four types of employee separation?
Organizations responsible for reinforcing societal values : Should organizations be responsible for reinforcing societal values? Why or why not?
Express the definition of function print of the class two : express the definition of function print of the class two.
Methodologies for reducing employee grievances : Consider a goal of management is to reduce the number of grievances filed by union employees each year. What are some ways that the HRM staff can contribute to this goal?
Explain e-business- discuss the effectiveness of the sears : Explain e-business- discuss the effectiveness of the sears
Explain the meaning of progressive discipline : Explain the meaning of "progressive discipline" and Do you believe that progressive disciplinary systems work? Why or why not? Please explain your answer.
Define difference between a shallow copy and a deep copy : Overload the operator += for the class newString to perform the following string concatenation; suppose that s1 is "Hello" and s2 it "there". Then the statement s1 += s2; should assign "Hello there" to s1, where s1 and s2 are newString objects.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Designing the class

Develop a test class with at least three unit tests for the program which translates a letter grade into the number grade. Letter grades are A, B, C, D, F, possibly followed by + or -.

  Dns servers and dhcp servers

Assume that both the DNS servers and the DHCP servers send your client PC and IP addresses. Write down the differences between these two addresses.

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Developing uml one state diagram

How the system responds to the external and/or internal events by developing a UML ONE State Diagram.

  Implement needham-schroeder protocol using python

Implement Needham-Schroeder protocol using python

  Address operating systems that .net does not support

Why will a company like Microsoft choose to create the .NET proprietary platform when J2EE is readily available? As a software developer, how could you address operating systems that .NET does not support.

  Uses and developing the class diagram

Choose one of the uses and develop a class diagram. Generate a sequence diagram for use case that you had selected.

  Plan a java class named mypoint to represent a point

create the class, and also write a test program that creates two points (0, 0) and (10, 30.5) and displays the distance between them.

  What is the definition of a crm

What features does the Internet advertising survey recommend for online marketing campaigns.

  What is the variety of addresses available in each networks

What is the variety of addresses available in each  networks

  Make a data structure that holds a persons address

make a data structure that holds a persons address. think about the different data elements of an an address and model them in a C data structure. One element that I am having a question on is how can I specify the state with only 2 characters?

  What is microprocessor - motorola 68k assembly language

What is microprocessor - Motorola 68k assembly language? Implement your plan using a user vectored interrupt number 3. Use busy line from the printer to trigger the interrupt. The printer interrupt level is 2. Explain the extra hardware to make t..

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