In C++ an unsigned int data type can save 4 bytes. If all four bytes are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. Make sure to make header and cpp files. Choose appropriate properties. Provide member functions: • Implement header file • Default and Parameterized constructor • Copy Constructor(shallow copy) • 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 add a hugeInteger type variable provided as an input and returns the sum as another huge Integer) isZero (return 1 if the number is zero, return 0 if number is non-zero) input [10,10,2,3,4,0,1] isEqualTo (compare two hugeIntegers) • isGreater Than (compare two huge Integers) o Above two function takes one huge integer type variable as an argument and returns true if the condition is satisfied and false otherwise = Note: Your program should only allow user to save single digit value on each location of array. i.e. any array location can hold value (0-9). For example I want to save an int value 34178994301116789033. This value cannot be saved in unsigned int data type. For this your huge Integer struct can be used. Each hugeInt class can save a hugeInt of length 20. Consider the following example void main() { huge Integer i(20); } i.setvalue(); // prompts the user to enter 20 digit number [0] [1] [2] 3 4 | 1 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] 1 6 7 8 9 0 3 3 7 8 9 9 4 3 0 11 Hugelnt type variable i containing array of size 20 Note: Make all variables private. Make all functions public. Make separate setter and getter functions for each variable. 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. Make sure to make header and cpp files. Choose appropriate properties. Provide member functions: • Implement header file • Default and Parameterized constructor • Copy Constructor(shallow copy) • 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 add a hugeInteger type variable provided as an input and returns the sum as another huge Integer) isZero (return 1 if the number is zero, return 0 if number is non-zero) input [10,10,2,3,4,0,1] isEqualTo (compare two hugeIntegers) • isGreater Than (compare two huge Integers) o Above two function takes one huge integer type variable as an argument and returns true if the condition is satisfied and false otherwise = Note: Your program should only allow user to save single digit value on each location of array. i.e. any array location can hold value (0-9). For example I want to save an int value 34178994301116789033. This value cannot be saved in unsigned int data type. For this your huge Integer struct can be used. Each hugeInt class can save a hugeInt of length 20. Consider the following example void main() { huge Integer i(20); } i.setvalue(); // prompts the user to enter 20 digit number [0] [1] [2] 3 4 | 1 [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] 1 6 7 8 9 0 3 3 7 8 9 9 4 3 0 11 Hugelnt type variable i containing array of size 20 Note: Make all variables private. Make all functions public. Make separate setter and getter functions for each variable.
Expert Answer:
Related Book For
Essential Statistics in Business and Economics
ISBN: 978-1260239508
3rd edition
Authors: David Doane, Lori Seward
Posted Date:
Students also viewed these computer engineering questions
-
The waiting time for rides at an amusement park has an Exponential distribution with average waiting time of 1/2 an hour (assume that the waiting times are independent). a. If a person rides 5 rides,...
-
The waiting time for treatment in a minute-clinic located in a drugstore is monitored using control charts for individuals and the moving range. Table 6E.24 contains 30 successive measurements on...
-
For low-risk drivers, the waiting time for their first accident follows an Exponential distribution with a mean of 7 years. For high-risk drivers, the waiting time for their first accident follows an...
-
Calculate the following ratios from the data given below: 1. Debt ratio 2. Debt service coverage multiples 3. Interest coverage Balance Sheet 12/31/2014 Assets Cash..$575,000 Short-term...
-
Cite an example of something with a constant speed that also has a varying velocity. Can you cite an example of something with a constant velocity and a varying speed? Defend your answers.
-
The pressure drop needed to force water through a horizontal 1-in.-diameter pipe is \(0.60 \mathrm{psi}\) for every 12 -ft length of pipe. Determine the shear stress on the pipe wall. Determine the...
-
Charting, Inc., a new audit client of yours, processes its sales and cash receipts documents in the following manner: 1. Payment on account. The mail is opened each morning by a mail clerk in the...
-
The manager of the Fore and Aft Marina in Problem 16 wants to investigate the possibility of enlarging the docking facility so that two boats can stop for gas and servicing simultaneously. Assume...
-
Comprehensively explains the financial cost of a total reward plan that incudes improvements in the health and wellness plan, 401(K) plan and a sick bank to both direct and indirect compensation ?
-
A. Richard McCarthy (born 2/14/64; Social Security number 100-10-9090) and Christine McCarthy (born 6/1/1966; Social security number 101-21-3434) have a 19-year-old son (born 10/2/99 Social Security...
-
The Great White Shark Company makes a surprise cash offer of $22 a share for Goldfish Industries. Before the offer, Goldfish was selling for $18 a share. Goldfish has 1 million shares outstanding....
-
Indicate whether each of the following statements is true or false by writing T or F in t he a nswer c olumn. The owner of cash who entrusts it to another cannot demand the return of the money from a...
-
The following table summarizes the financial assets and financial liabilities of PL Banking Corporation in a tabular format. Required: 1. Discuss the nature of the interest rate risks facing PL...
-
The theory of comparative advantage predicts that athletes perform better when they specialize. Studies show that young athletes are increasingly focusing on a single sport. Do you think this is a...
-
Indicate whether each of the following statements is true or false by writing T or F i n t he a nswer c olumn. The Robinson-Patman Act prohibits price discrimination.
-
Why do sports generate so much more news coverage than other industries that are much larger in financial terms?
-
Undertake a critique of the different traditions of corporate governance in the UK/USA, Germany and Japan in terms of your own views of their strengths and weaknesses. Is there a better system than...
-
In exchange for land, the company received a 12-month note on January 1. The face amount of the note is $1,000, and the stated rate of interest is 13%, compounded annually. The 13% rate is equal to...
-
A sample of 40 songs from a students iTunes playlist showed a mean length of 3.542 minutes with a standard deviation of 0.311 minute. Construct a 95 percent confidence interval for the population...
-
A vehicle emissions testing facility can process up to 100 cars in an hour and the facility is open 7 am?5 pm Monday?Thursday. Shown below are the number of cars processed each hour last week. (a)...
-
Are the variables cross-sectional data or time-series data?
-
Compute the following probabilities: a. If \(Y\) is distributed \(t_{15}\), find \(\operatorname{Pr}(Y>1.75)\). b. If \(Y\) is distributed \(t_{90}\), find \(\operatorname{Pr}(-1.99 \leq Y \leq...
-
\(Y\) is distributed \(N(5,100)\), and you want to calculate \(\operatorname{Pr}(Y <3.6)\). Unfortunately, you do not have your textbook, and do not have access to a normal probability table like...
-
The random variable \(Y\) has a mean of 1 and a variance of 4. Let \(Z=\frac{1}{2}(Y-1)\). Show that \(\mu_{Z}=0\) and \(\sigma_{Z}^{2}=1\).
Study smarter with the SolutionInn App