Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ an unsigned int data type can save 4 bytes. If all four bytes are being used for its value (i.e. this is an

  1. In C++ an unsigned int data type can save 4 bytes. If all four bytes are being used for its value (i.e. this is an unsigned integer) then you have 8 * 4 = 32 bits, so your range is from 0 to 2^32 (0 - 4,294,967,295). If we conclude the above statement, the maximum range for storing an unsigned int is 4,294,967,295 i.e. upto 10 digits. If any number larger than that is saved it will result in truncation. Create a class hugeInteger that uses a N-element array of digits to store integers as large as Ndigits. Choose appropriate properties. Provide member functions:
  • Default constructor
  • Parameterized constructor
  • Copy Constructor
  • Destructor
  • Input (take 20 values for 20 array locations from user. Each location can only contain 0-9 )
  • Output (cout the whole array i.e. 20 digit integer)
  • Add ( to assdd a hugeInteger type variable provided as an input and returns the sum as another hugeInteger)
  • isZero (return 1 if the number is zero, return 0 if number is non-zero)
  • isEqualTo (compare two hugeIntegers)
  • isGreaterThan (compare two hugeIntegers)
    • Above two function takes one huge integer type variable as an argument and returns true if the condition is satisfied and false otherwise
    • There should be no memory leakage, shallow copies and bad pointers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago