This C++ program demonstrates advanced operator overloading using custom classes Whole and Decimal. The program supports various operations such as arithmetic, comparison, and logical operators. It also showcases user input and output functionalities, utilizing custom printing functions and the ability to handle boolean logic.
- โ Addition (
+): Overloaded to perform addition onWholeandDecimaltypes. - โ Subtraction (
-): Overloaded to perform subtraction onWholeandDecimaltypes. - โ๏ธ Multiplication (
*): Overloaded to perform multiplication onWholeandDecimaltypes. - โ Division (
/): Overloaded to perform division onWholeandDecimaltypes. - ๐งฎ Equality (
==): Compares twoWholeorDecimalobjects for equality. - ๐ฒ Logical AND (
&&): Performs logical AND operation betweenWholeorDecimaltypes. - ๐ณ Logical OR (
||): Performs logical OR operation betweenWholeorDecimaltypes. - ๐ฅ๏ธ User Input and Output: Handles user input for
Decimalvalues and prints the results of operations. - ๐ก Custom Printing Function: Utilizes
yoi::printandyoi::printerfor formatted output.
-
Clone the repository:
git clone <repository_url>
-
Navigate into the project directory:
cd cpp-operator-overloading-final -
Compile the C++ program:
g++ finalc.cpp -o finalc
-
Run the program:
./finalc
- ๐
finalc.cpp- The C++ source file containing the logic for operator overloading, arithmetic, logical, and comparison operations. - ๐
README.md- This file, containing details about the project.
This project is licensed under the MIT License - see the LICENSE file for details.
๐ง Explore operator overloading and custom input/output handling in C++! ๐ป