Thread: homework

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    1

    homework

    Write a program to implement the following single inheritance of classes with private visibility mode.
    Class parent is a class Point that contains the private section with members:

    coordinates of point (2D, float)
    and public section with members:

    constructor

    destructor

    access functions

    function distance(float x, float y) that returns distance between coordinates x and y that pass to function and object of class

    function coorx(float d) that returns coordinate x of point that is placed on distance d from the object of class but the coordinate y of this point has the same value as object of class

    function coory(float d) that returns coordinate y of point that is placed on distance d from the object of class but the coordinate x of this point has the same value as object of class

    function print() that prints the values of private members.
    Class child is class Square that contains the private section with members:

    length of diagonal (float)
    and public section with members:

    constructor

    destructor

    access function

    function coordinates(float x, float y) that returns the coordinates of all vertices and coordinates of intersection of diagonals of object of class if the one vertex has coordinates x and y that passes to function (sides of object of class in parallel to axis of system coordinates)

    function side() that returns length of sides of object of class

    function distance(Square) that returns distance between intersections of diagonals of square that passes to function and object of class

    function print() that prints the length of side and coordinates of all vertices of object of class
    Test class Square in main program.

  2. #2
    Registered User joybanerjee39's Avatar
    Join Date
    Oct 2011
    Location
    kolkata
    Posts
    106
    printf("requested task could not to performed!");
    exit(1);

  3. #3
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    I.e., post the code you've written.

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    Write a program to implement the following single inheritance of classes with private visibility mode.
    Class parent is a class Point that contains the private section with members:
    Also looks more like C++ homework than C homework.

    Jim

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    10

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can somebody help me with my homework in c++
    By gosse in forum C++ Programming
    Replies: 19
    Last Post: 04-29-2011, 02:10 PM
  2. My homework
    By Bala in forum C++ Programming
    Replies: 5
    Last Post: 06-12-2010, 11:11 AM
  3. help about homework
    By agathery in forum C Programming
    Replies: 27
    Last Post: 05-19-2010, 09:17 PM
  4. homework
    By misplaced in forum C++ Programming
    Replies: 18
    Last Post: 10-04-2004, 06:56 AM
  5. I want homework!
    By Tynnhammar in forum C++ Programming
    Replies: 9
    Last Post: 09-29-2004, 02:49 PM