DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Can Anyone Make this programm for me Please??

  1. #1
    Join Date
    Jan 2007
    Posts
    2

    Question Can Anyone Make this programm for me Please??

    Hello everyone ! i am a new student in c++. i cudnt keep it up with lecturs so i am behind other students. i dont have even a single class fellow in my city. i need to make this programm. can anyone make it for me please?? i will write this program just like my universiy agave me in asignment..
    Write down a program which consists of writing a CRectangle class, with the class definition in a .h file, and the implementation in a .cpp file.
    So there should be three files provided with this program.
    1. CRectangle.h
    2. CRectangle.cpp
    3. MainProgram.cpp

    Steps to follow.
    1. The class should have 4 members: iTop, iRight, iBot, and iLeft, all of type int.
    2. It should have a default constructor and a copy constructor.
    3. It should have a destructor.
    4. It should have getters and setters for each member.
    5. It should contain the following member functions: Height, Width, Area, Perimeter, and Intersect.
    6. The Intersect function should have another rectangle as the input, and return a bool based on whether the two rectangles intersect.
    * Intersect() function determines if two rectangles share a common area.
    7. It should contain a static member, iRefCount, which keeps track of the number of CRectangle objects. Increment it in the constructor, and decrement it in the destructor.
    8. It should have any other attributes or member functions needed to make the class complete.

    Sample output.
    Area of rectangle 1 is 1600
    Area of rectangle 2 is 400
    The two rectangles intersect.
    The number of rectangles is 2
    The number of rectangles is 3
    The number of rectangles is 2
    ________________________________________
    please , if anyone make this programm then let me kkowand send me at salman.yaqub@yahoo.com. i know its like a headache but i will be really grateful to you all. thanks..

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    What u have tried to make ? where u have stoped ? we can help u solving your coding problems but not doing the complete homework .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Jan 2007
    Posts
    2

    Unhappy Ahhhhh ! what i do..

    yeah.. ur right.. i am ot supposed to ask for the whole programm. but i just cant start it as i am not even sure what i REALLY have to do in this programm. i dont have any sense of this progm at all.. i think i shud take lectures that i missed... but time will be Over as wel. anyways.. thanks

  4. #4
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    just give a try.. look again in what he want exactly , make those classes .. anytime if u got a problem ask here , isa u will have good answers .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  5. #5
    Join Date
    Nov 2003
    Posts
    4,118
    Start with whatever you know, and when you get stuck, you cna ask here specific questions as Amahdy said. We don't do homework here, and if you skipped a few classes, you can contact your instructor or felloe students and ask for their notes from the missed lectures. At the end of the day, you will need to know some C++ or else it would be cheating. Recall also that quite a few intrsutcors lurk on our forums, catching miscreant students. My advice is therefore to get started on your own.
    Danny Kalev

  6. #6
    Join Date
    Jun 2006
    Location
    Zagreb
    Posts
    49
    Well, since the start is the most difficult problem at your level (I would call it dummy level), I'll help you with code-skeleton. Answer my questions, and post explanations, and we can talk some more. I assume you know little or nothing about C++, so this will be something like a crash course.

    Here is where your program starts.

    Code:
    // MainProgram.cpp file
    // include needed headers
    
    int main() // what about this function?
    {
    	CRectangle rect; // what will this line of code do?
    
    	// what header do you need to include to use cout and endl?
    	cout << rect.Height() << endl; 
    }
    Code:
    // CRectangle.h file
    
    class CRectangle // what the class keyword means?
    {
    	private: // private vs. public?
    		int iTop;
    		int iRight;
    		int iBot;
    		int iLeft;
    
    		static unsigned int iRefCount; // learn what static means in this case
    
    	public:
    		// here comes default constructor
    		// here comes copy constructor
    		// here comes destructor
    
    		// here is example of one of set/get pair; do likewise for all member variables
    		void SetTop( int top );
    		int GetTop() const; // find out what this const means...
    
    		// here is example of one of memeber functions; do likewise for all the other
    		// memeber functions
    		int Height() const;
    };
    I'll continue when you're done with this.
    aliens are friends

Similar Threads

  1. November Tip - Make VB's Dialog Boxes Larger
    By Larry Rebich in forum vb.announcements
    Replies: 2
    Last Post: 10-14-2000, 12:37 AM
  2. STILL Can't make buttons WORK!!
    By superwebmonkey in forum Java
    Replies: 2
    Last Post: 05-13-2000, 09:28 PM
  3. make JFrame unresizeable
    By Penny in forum Java
    Replies: 1
    Last Post: 05-11-2000, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center