Requirements
Write a class that represents a fraction number like 2/3.
Functions below have to be implemented for this class:
•default ctor
•ctor takes two integers as parameters
•copy ctor
•arithmetical operators: + - * /
•relational operators: < <= == != >= >
•type cast to double
•to string
•inserter and extractor for streams
•from a finite decimal string like: 1.414
Evaluation standard
1.c++ code quality (clean, compact and reasonable)
2.comments quality
Files to submit
Please prepare a .zip package including the following items:
1.the source code (including the Fraction class, and some typical usages for test)
2.makefile (for Mac or Linux users) or .exes (for Windows users) or CMakeLists.txt
版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。