Computer Science Homework Solutions
Problem
#103459

Data Structures C++

Find the syntax errors in the definitions of the following classes. See attached file for full problem description.

Attached file(s):
Attachments
chap1#11.doc  View File
Chap1#14.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

chap1#11.doc
11. Find the syntax errors in the definitions of the following classes:

a.

class AA

{

public:

void print();

int sum();

AA();

int AA(int, int);

private:

int x ;

int y ;

};

b.

class BB

{

int one ;

int two;

public:

bool equal();

print();

BB(int, int);

}

c.

class CC

{

public:

void set(int, int);

void print();

CC();

CC(int, int);

bool CC(int, int);

private:

int u;

int v;

};
Chap1#14.doc
14. Consider the definition of the following class:

class testClass

{

public:

int sum();

//Postcondition: Returns the sum of the private data members.

void print() const;

//Prints the values of the private data members.

testClass();

//default constuctor

//Postcondition: x = 0; y = 0

testClass(int a, int b);

//constructor with parameters

//Initializes the private data members to the

//values specified by the parameters.

//Postcondition: x = a; y = b

private:

int x;

int y;

};

Write the definitions of the member functions as described in the
definition of the class testClass.

Write a test program to test the various operations of the class
testClass.
Solution
What is this?
By OTA - Overall OTA Rating
Xiao Liu, MS - 4.7/5
Purchase Cost Now
$2.19 CAD (was ~$15.96)
Included in Download
  • Plain text response
  • Attached file(s):
    • chap1#11.doc
    • testClass.cpp
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse