## 26.8.15

### Create a 'DISTANCE' class

Create a 'DISTANCE' class with :

-     feet and inches as data members

-     member function to input distance

-     member function to output distance

-     member function to add two distance objects

Write a main function to create objects of DISTANCE class. Input two distances and output the sum.

#include<iostream.h>

#include<conio.h>

class distance

{
int feet,inch;
public:
void getdistance(); void putdistance();

void adddistance(distance d1,distance d2);
};

void distance::getdistance()

{

cout<<"\nEnter the feet : "; cin>>feet;
cout<<"\nEnter the inches :"; cin>>inch;
}

void distance::putdistance()
{
cout<<"\n\nfeet = "<<feet; cout<<"\tinch = "<< inch;

}
void distance::adddistance(distance d1,distance d2)
{
inch=d1.inch+d2.inch;
feet=inch/12;
inch=inch%12;
feet=feet+d1.feet+d2.feet;
}

int main()

{

distance d1,d2,d3; clrscr();

cout<< "\nDistance 1 \n"; d1.getdistance();

cout<< "\nDistance 2 \n"; d2.getdistance(); d3.adddistance(d1,d2);
cout<<"\nThe Sum Of two distance is : "; d3.putdistance();
getch();

return(0);
}

*********************************OUTPUT****************************

Distance 1

Enter the feet : 13

Enter the inches :11

Distance 2

Enter the feet : 11

Enter the inches :11

The Sum Of two distance is :

feet = 25   inch = 10

#### 65 comments:

1. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
Best Microsoft Azure Training Institute in Chennai | Best Microsoft Azure Training Institute in Velachery

2. Useful information and Please keep updating us..... Thanks for sharing...
Best VMware Training Institute in Chennai | Best VMware Training Institute in Velachery

3. Fast our site definitely will unquestionably turn out to be widely known with virtually all operating a blog families, because of its meticulous content pieces and / or review articles. UKdistance

4. This data can be mileage calculator effectively assembled just by getting to a calculator made for the reason.

5. This is really too useful and have more ideas from yours. keep sharing many things and thanks for sharing the information.

Best python training institute in Kanchipuram

6. This is really too useful and have more ideas from yours. keep sharing many things and thanks for sharing the information.

Best python training institute in Kanchipuram

7. Nice and informative article. Thanks for sharing such nice article, keep on updating.

CandC++ programming training academy in Kanchipuram

8. Awesome post. Really you are shared very informative concept... Thank you for sharing. Keep on updating...

Best Graphics Designing Training Academy in Kanchipuram

9. Very good informative blog, keep sharing
Best Tally ERP 9.0 Training Academy in Kanchipuram

10. Thank you so much for sharing. Keep updating your blog. It will very useful to the many users.
Best Web Designing Training Academy in Kanchipuram

11. Thank you so much for sharing. Keep updating your blog. It will very useful to the many users.
Best Web Designing Training Academy in Kanchipuram

12. I have read your blog its very attractive and impressive. I like it your blog.
Best Software Testing Training Academy in Kanchipuram

13. Your Blog is nice and informative..Thanks for sharing this valuable information with us..I am visiting this website regularly, this web site sharing nice thoughts

Best MATLAB Training Academy in Kanchipuram

14. Thanks for this grateful information. all this information is very important to all the users and can be used good at all this process.

Best Web Designing Training Academy in Kanchipuram

15. Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing.
Best Tally erp9 Course Training Institute in kanchipuram|

16. Nice..You have clearly explained about it ...Its very useful for me to know about new things..Keep on blogging..
Best JAVA and J2EE Course Training Institute in kanchipuram|

17. Hi, am a big follower of your blog. I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post. keep update your blog.
Best CCNA Course Training Institute in kanchipuram|

18. Great post.Thanks for one marvelous posting! I enjoyed reading it;The information was very useful.
Best Best Web Designing and Development Course Training Institute in kanchipuram|

19. great doing. and i happy to visit your blog to know about this wonderful information. thanks for sharing. keep updating.
Best Best Web Designing and Development Course Training Institute in kanchipuram|

20. Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
Best Python Course Training Institute in kanchipuram|

21. Very impressive and informative blog.. thanks for sharing your valuable information.. it is very useful and easy to learn as well... keep rocking and updating... looking further..
Best Tally Erp9.0 Course Training Institute in kanchipuram|

22. Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging.
Best Web Technologies Course Training Institute in kanchipuram|

23. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Best Linux Certification Course Training Institute in kanchipuram|

24. Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging.
Best Web Technologies Course Training Institute in kanchipuram|

25. Nice and informative content..keep sharing such an wonderful blog..
Best Advanced Amazon Web Services Course Training Institute in kanchipuram|

26. Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated.
Best Tally ERP 9 Course Training Institute in kanchipuram|

27. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
Best Graphic Designing Course Training Institute in kanchipuram|

28. Wonderful Blog with impressive content..keep updating..
Best Python Training Course Training Institute in kanchipuram|

29. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me
Best PCB Training Course Training Institute in kanchipuram|

30. This is excellent information. It is amazing and wonderful to

visit your site.Thanks for sharing this information, this is useful

to me…no:1selenium automation training

institute in kanchipuram.

31. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…no:1
HP QTP / UFT Automation training institute in kanchipuram.

32. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
No:1 Tally Training Academy in kanchipuram

33. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
No:1 Tally Training Academy in kanchipuram

34. Really it was an awesome information...very interesting to read..You have provided an nice blog....Thanks for sharing..
Best JAVA / J2EE / J2ME Course Training Institute in kanchipuram|

35. Excellent post. I have read your blog it's very interesting and informative. Keep sharing.
Best JAVA / J2EE / J2ME Course Training Institute in kanchipuram|

36. Nice post.. Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating...
Best C & C++ Course Training Institute in kanchipuram|

37. Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's.
Best Tally Erp 9.0 Course Training Institute in kanchipuram|

38. This is really impressive post, I am inspired with your post, do post more blogs like this, I am waiting for your blogs.
Best Tally Erp 9.0 Course Training Institute in kanchipuram|

39. Interesting post!!! Thanks for posting such a useful information. I wish to read your upcoming post to enhance my skill set and keep blogging.
Best Tally Erp 9.0 Course Training Institute in kanchipuram|

40. very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing..
No:1 Tally Training Academy in kanchipuram

41. This is excellent information. It is amazing and wonderful to visit your

site.Thanks for sharing this information, this is useful to me.
Best Selenium

Automation Course Training Institute in kanchipuram
|

42. very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing..
No:1 Tally Training Academy in kanchipuram

43. Very good and informative information. Thanks for sharing such nice blog, keep on updating such good post.
Best Software Testing Course Training Institute in kanchipuram|

44. I have read your blog. Good and more information useful for me, Thanks for sharing this information keep it up....
Best Dot Net Course Training Institute in kanchipuram|

45. Really it was an awesome blog...very interesting to read..You have provided an nice information....Thanks for sharing..
Best Hardware & Networking Course Training Institute in kanchipuram|

46. Thanks for sharing in this blog...its very useful for us...keep on going...
Best MS Office Course Training Institute in kanchipuram|

47. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it.
Best PCB (Printed Circuit Board) Course Training Institute in kanchipuram|

48. Thanks for making me this Blog. You have done a great job by sharing this content here. Keep writing blog like this
No:1
Graphic Design Training Academy in kanchipuram

49. Wow Very Nice Information Thanks For Sharing It.keep update…
Best EEE Project Centre Training Institute in kanchipuram|

50. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
Best PCB (Printed Circuit Board) Course Training Institute in kanchipuram|

51. Nice blog. Thank you for sharing. The information you shared is very effective for

learners I have got some important suggestions from it.
No:1 Hardware and Networking

Training Academy in Kanchipuram

52. I love reading and following your post as I find them extremely informative and interesting.
Best AWS (Advanced Amazon Web Services) Course Training Institute in kanchipuram|

53. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it…
No:1
Embedded Systems Training Academy in kanchipuram

54. Awesome post. Really you are shared very informative information... Thank you for sharing. Keep on updating...
Best AWS (Advanced Amazon Web Services) Course Training Institute in kanchipuram|

55. Great post..Its very useful for me to understand the information..Keep on blogging..
Best Software Testing Course Training Institute in kanchipuram|

56. Nice..You have clearly explained about the conept..Its very useful for me to undertand..Keep on sharing..

No:1 Azure Training Academy in Kanchipuram

57. I found some useful information in your blog, it was awesome to read, thanks for sharing this great information to my vision, keep sharing.
Best Graphic Designing Course Training Institute in kanchipuram|

58. Marvelous and fascinating information.Thanks for this greatful blog. keep your blog updated.
Best Hardware & Networking Course Training Institute in kanchipuram|

59. Thanks a lot for offering this unique post with us. I really enjoyed by reading your blog post.keep sharing.
Best Python Course Training Institute in kanchipuram|

60. This is really awesome. Full of knowledge and latest information.Thanks for sharing.
Best JAVA / J2EE / J2ME Course Training Institute in kanchipuram|

61. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
No:1 python Training Center in Kanchipuram

62. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
No:1 Best EEE Project Center in kanchipuram|

63. The provided information’s are very useful to me.Thanks for sharing.Keep updating your blog.No:1 ECE project Centre in kanchipuram

64. really you have posted an informative blog. it will be really helpful to many peoples. thank you for sharing this blog. so keep on sharing such kind of useful blogs.
No:1 Best NS2 (Network Simulator) Project Center in kanchipuram|

65. The provided information’s are very useful to me.Thanks for sharing.Keep updating your blog.No:1 Bit data project Centre in kanchipuram

Comment Here