Question: Write a C++ program that utilizes operator overloading Appreciate the ability to program using notation closer to the target domain Establish a class which can




Write a C++ program that utilizes operator overloading Appreciate the ability to program using notation closer to the target domain Establish a class which can be used for arithmetic operations on binary numbers as well as IPv4, where computational representations of mathematical objects are manipulated with the same syntax as on paper Part One: Internet Protocol version 4 (IPv4) is still used for most of the Internet traffic today. It is one of the core protocols of standards-based internetworking methods in the Internet IPv4 uses 32-bit addresses which limits the address space to 4294967296 (232) addresses. Each IP address is made of four octets (eight bits each). For example IP address 158.94.1.1, can be represented as 10011110.01011110.00000001.00000001 in binary For the first part of the assignment establish an "Address" class to represent IP addresses. The Address class will have private data members for the decimal and binary representations separately. The IPv4 addresses where the fist octet starts with 0 (in binary representation) are class A, with 10 are class B and 110 are class C.The structure of IPv4 addresses can be summarized as follows: Set Bits (First Octet) Natural Mask No of host Addresses Class 255.0.0.0 255.255.0.0 255.255.255.0 224-2 216-2 23-2 10nnnnnn Write the following operators for your Address class 1. unary operator will print the class of the address object. 2. + perform bitwise logical disjunction operation and return the result to another address object. 3. *perform bitwise logical conjunction operation and return the result to another address object. 4. - perform bitwise NOR operation and return the result to another address object. 5. / perform bitwise NAND operation and return the result to another address object. 6. % perform bitwise XOR operation and return the result to another address object. Write a C++ program that utilizes operator overloading Appreciate the ability to program using notation closer to the target domain Establish a class which can be used for arithmetic operations on binary numbers as well as IPv4, where computational representations of mathematical objects are manipulated with the same syntax as on paper Part One: Internet Protocol version 4 (IPv4) is still used for most of the Internet traffic today. It is one of the core protocols of standards-based internetworking methods in the Internet IPv4 uses 32-bit addresses which limits the address space to 4294967296 (232) addresses. Each IP address is made of four octets (eight bits each). For example IP address 158.94.1.1, can be represented as 10011110.01011110.00000001.00000001 in binary For the first part of the assignment establish an "Address" class to represent IP addresses. The Address class will have private data members for the decimal and binary representations separately. The IPv4 addresses where the fist octet starts with 0 (in binary representation) are class A, with 10 are class B and 110 are class C.The structure of IPv4 addresses can be summarized as follows: Set Bits (First Octet) Natural Mask No of host Addresses Class 255.0.0.0 255.255.0.0 255.255.255.0 224-2 216-2 23-2 10nnnnnn Write the following operators for your Address class 1. unary operator will print the class of the address object. 2. + perform bitwise logical disjunction operation and return the result to another address object. 3. *perform bitwise logical conjunction operation and return the result to another address object. 4. - perform bitwise NOR operation and return the result to another address object. 5. / perform bitwise NAND operation and return the result to another address object. 6. % perform bitwise XOR operation and return the result to another address object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
