Archived

This topic is now archived and is closed to further replies.

Help on programming project?

This topic is 5144 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guys following is the programming project that I have to write. But, the problem is that I dont know how to start. I confused. Can anyone tell me where/how go about starting this project. Your help will be appriciated. The Project: This programming project is designed to give students experience with object oriented programming and arrays in C++. The goal is to build some "geometric object" classes that would be useful for a computer graphics application. In this assignment, your task is to design, implement and test classes to store information about Points and Lines. In the next assignment, you will create a class for Polygons and use some existing code to generate graphics images. Clearly, there is not time to implement every possible operation for these geometric objects. Students are only required to write methods for the following: Point: - constructor(s) - return x coordinate - return y coordinate - change x coordinate - change y coordinate - print coordinates - calculate the distance between two points Line: - constructor(s) - return starting point - return ending point - change starting point - change ending point - print line equation of form ax + by + c = 0 - calculate the distance from a point to the line To test your classes, write a main program that initializes 10 points with random coordinates between 0 and 999, and 10 lines with random end points between 0 and 999. Then, calculate the distances from the first point to all other points, and calculate the distance from the first point to all lines. Output this information in an easy to read table.

Share this post


Link to post
Share on other sites
You triple posted (go back, edit them, and click the "delete post" check at the top)
-----------
What don't you understand?


It sounds like you have no clue how to write classes in c++.
I'm *sure* you have some sort of book that you bought for this course. Go check up the info about "classes" in the book.

That's all you'll get out of me, what you need to do is go back and read the book especially the part about classes and objects.

Oh and if you're confused about objects - they don't have to represent geometrical objects, they're just supposted to represent some abstract... thing... with, stuff in it, that... does stuff. (can't get much more abstract than that.) Anyway, you can write a class to represent most group of stuff in code.

FYI, if anyone replies with RTFM, it means
Read The Manual! with your choice of word for the 'F' part. (And they're right - you should.)

-Michael

EDIT: took out my "push in the right direction"

[edited by - thr33d on November 12, 2003 3:27:27 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by vish40
But, the problem is that I dont know how to start. I confused. Can anyone tell me where/how go about starting this project.



you start by looking at the specs. It looks to me that all the details of what you have to do is already layed out for you. All you have to do is code it and implement it. This is pretty straightforward I don''t see how you could get confused with this. Write the class by writing it''s parts. Once you''re done with one part move to the next. You might wanna test the part you''ve just written to make sure it works as expected. If you don''t know how to write a class then as the posters above me mentioned RTFM





--{You fight like a dairy farmer!}

Share this post


Link to post
Share on other sites