- A Decimal Number Is Composed Of An Integral Part And A Fractional Part The Number Appearing Before The Decimal Point Is 1 (84.06 KiB) Viewed 13 times
A decimal number is composed of an integral part and a fractional part. The number appearing before the decimal point is
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
A decimal number is composed of an integral part and a fractional part. The number appearing before the decimal point is
A decimal number is composed of an integral part and a fractional part. The number appearing before the decimal point is an integral part while the number appearing after the decimal point is called the fractional part. For example, if our number is 1.2 then 1 is an integral part while 2 is the fractional part. Using this concept develop the following class. Your task is to overload the prefix and postfix increment operators for a class called roundoff. The roundoff class has a floating point data member called number. Overload the operators as follows. . Overload the stream insertion and extraction operators to input/output the data. . Prefix increment - When this operator is called there will be an increment in the integer part of the number. For example, if our original number is 3.5 then after prefix increment the result will be 4.5 Postfix increment - When this operator is called there will be an increment in the fractional part of the number. For example, if our original number is 3.5 then after postfix increment the result will be 3.6.