Computer Science Homework Solutions
Problem
#130862

Visual C++

Give the class declaration

class point
{
public:
int xcoordinate();
int ycoordinate();
point(in initializeX, in initialize Y);
private:
int x;
int y;
};



1: Suppose we have a type declaration as follows:
enum status {on, off};

declare a class Pixel that inherits from class Point. Class Pixel will have an additional data member of type Status name Statustype; it  has its own constructor that recieves three parameters.

2. write cleint statements that creates Pixel objects, FirstPixel with an initial (x,y) position of (5,9) and status OFF

3.Write client code to print out the current X and  coordiantes and the status of the first pixel

4. Write the function definitions of the Pixel class constructor adn the CurrentStatus member functions.

Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • 130862.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
  • The definition of a constructor. - What is a constructor?
  • Data Structures C++ - Find the syntax errors in the definitions of the following classes. See attached file for full problem description.
  • Write a constructor - Can someone write a constructor method for the class "Dog" that uses the "this reference" and explain what it does?
  • Stuck on coding Java IOExceptions - My problem is an exception class called ChatIOException that extends from IOException that is imported from the java.io package in order to extend IOException. Also, the ChatIOException class is with ...
  • Java Programming - I'll give a start; this is the class definition; it has one member variable, one constructor method, and another public method: public class Car { private int no_doors; public Car(in ...
Browse