please do this C++ question asapCode for Operator Overloading :
#include <iostream>
using namespace std;
class HugeInteger {
double s;
public:
void getnum(double str)
{
this->s=str;
}
void operator==(HugeInteger); // for ==
void operator+(HugeInteger); // for +
void operator*(HugeInteger); // for *
};
void HugeInteger::operator==(HugeInteger ob)
{
if(s==ob.s)
cout<<"\nIntegers are Equal";
else
cout<<"\nIntegers are not Equal";
}
void HugeInteger::operator+(HugeInteger ob)
{
HugeInteger sum;
sum.s=s+ob.s;
printf("The Sum of Integers is %f",sum.s);
}
void HugeInteger::operator*(HugeInteger ob)
{
HugeInteger mul;
mul.s=s*ob.s;
printf("The MUltiplication of Integers is %f",mul.s);
}
int main()
{
HugeInteger ob, ob1;
double num1, num2;
cout<<"Enter First number:";
cin>>num1;
ob.getnum(num1);
cout<<"\nEnter Second Number:";
cin>>num1;
ob1.getnum(num2);
ob==ob1; // Overloading ==
ob+ob1; //Overloading +
ob*ob1; //Overloading *
return 0;
}
Output:

please do this C++ question asap Create a class Hugelnteger that uses a 40-element array of...
In C++: Implement a class Polynomial that uses a dynamic array of doubles to store the coefficients for a polynomial. This class does not need the method the overloaded += operator. Your class should have the following methods: Write one constructor that takes an integer n for the degree of a term and a double coefficient c for the coefficient of the term and creates the polynomial c x^n. (This constructor can be given default arguments easily to have a...
In C++, please do not google Problem Description: Create a Dynamic 2D Array Class. This class should overload the Call Operator () for the following behaviors: Return (modifiable) Lvalue element for a non-const object Return (read-only) Rvalue element for a const object Return a copy of the data values for row Return a copy of all the data as a 1D vector Create a TestScores Class which uses a Dynamic 2D Array object as an internal data structure. This class...
3. (Dynamic Array) In C++, the largest int value is 2147483647. So. an integer larger than this cannot be stored and processed as an integer. Similarly, if the sum or product of two positive integers is greater than 2147483647, the result will be incorrect. One way to store and manipulate large integers is to store each individual digit of the number in an array. Your program must, at least, contain a function to read and store a number into an...
c++ please Create a my pair class class that uses an array to store pairs of elements. The data members of the class are first and second. Use a template to allow the class to store pairs of any type so that a pair may be (int, int) or (int, double) or (int string), or any other combination you can think of. Create a member function to display the pair in the format "value, value" with a comma separating them....
Write a program in C++ that uses a class template to create a
set of items.
. . The Problem Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 Hint: Use vectors and vector functions to store the set of...
REQUIREMENTS: Problem Description: Create a Dynamic 2D Array Class. This class should overload the Call Operator () for the following behaviors: Return (modifiable) Lvalue element for a non-const object Return (read-only) Rvalue element for a const object Return a copy of the data values for row Return a copy of all the data as a 1D vector Create a TestScores Class which uses a Dynamic 2D Array object as an internal data structure. This class should have the following behaviors:...
In C++ Do not use classes. Write a function to add two integers of any length, say up to 200 digits. he suggested approach as follows: treat each number as a list array, each of those elements is a block of digits of that number ( say block of 1 to 4 digits, your choice). For example the integer 123456789101112 might be stored as N(1)=1112, N(2)=8910, N(3)=4567, N(4)=123. then add two integers (list) element by element, caring from one element...
Create a class Huge Integer that uses a40-elementarray of digits to Store integers as large as 40 digits each. Provide member functions input, output, add and subtract. For comparing Huge Integer objects, provide functions is Equal To, is Not Equal To, is Greater Than, Is Less Than, is Greater Than Or Equal To and is Less Than Or Equal To—each of these is a “predicate” function that simply returns true if the relationship holds between the two Huge Integers and...
How to solve this Problem in C++
. The Problem Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the set...
Please write below code in C++ using Visual
Studio.
Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 • Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the...