使用cm和meter创建一个类距离作为数据成员。使用友元函数重载++运算符,使其以cm为单位递增100,并按米递增1 [英] Create a class distance with cm and meter as data member. Overload ++ operator with friend function so that it increments cm by 100 and meter by 1

查看:84
本文介绍了使用cm和meter创建一个类距离作为数据成员。使用友元函数重载++运算符,使其以cm为单位递增100,并按米递增1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请解决问题并将答案邮寄给我,请等待你的回复

please solve the question and mail the answer to me kindly waiting for ur reply

推荐答案

我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是你想的很难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!


这是一个专业提示:

找另一门课程!即使从提供的少量信息中我也会说,作业使用了我在近30年的C ++编程中看到的最不敏感和愚蠢的设计思想。使用OO编程完全没有任何关系,最多只能用无意义的方式教导重载操作符。如果本课程中的其他作业具有相似的质量,那么最好从教科书或网络文章中学习C ++和OO!
Here's a pro tip:
Find another course! Even from the little information provided I'd say that assignment uses the most insensible and stupid design ideas I've seen in almost 30 years of C++ programming. It's got nothing to do at all with OO programming, and at best will serve to teach overloading operators in a nonsensical way. If other assignments in this course are of a similar 'quality', you're better off learning C++ and OO from text books or web articles!


这篇关于使用cm和meter创建一个类距离作为数据成员。使用友元函数重载++运算符,使其以cm为单位递增100,并按米递增1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆