Large Integer Class

Completed Posted Nov 3, 2003 Paid on delivery
Completed Paid on delivery

| | **Overview** | |

The range of values of an integer in the C++ language depends on the system. For example, some systems represent an integer with 2 bytes, while others represent an integer with 4 or more bytes. If an integer is represented by 2 bytes, then the range of values is -32768 to 32767 (one bit used for the sign). Your job will be to write a large integer class. This class will be able to perform basic arithmetic operations on integers up to 20 digits in length.

## Deliverables

**Problem**

Design a class called LargeInt which represents an integer with up to 20 digits. The class should have the following members.

1. Constructors.

1. A default constructor.

2. A copy constructor.

3. A constructor that takes a std::string which will consist of 1 to 20 characters that are all digits. This string will represent a LargeInt value.

2. Overloaded arithmetic operators, +, -, and *. Notice that your operators must test for overflow. If overflow occurs, display a message to that effect then quit the program.

3. Overloaded stream operators << and >>. Notice operator << will display a LargeInt and operator >> will extract a LargeInt from the keyboard.

You may include other members in the class if you like. These are the minimum requirements for the class.

**Program Operation**

You must write a program to test your LargeInt class as follows.

1. When the program is run, the user must be presented with a menu as follows.

1. Test operator +.

2. Test operator -.

3. Test operator *.

2. Quit.

For each of the operations, the user must be prompted to enter two LargeInts. The user will enter a string of digits (1 to 20) for each LargeInt. Your program must then display both LargeInts then the result of the operation. The menu must recycle after the operation is performed.

**Program Requirements**

Your program must have the following features.

1. At least one class (LargeInt).

2. A menu to greet the user.

3. Use of the keyword const in two contexts.

1. Use const for a constant member of a class.

2. Use const in a parameter list for one of the parameters that is passed.

4. Use of a data structure (You may not use the STL for this).

5. Use of a friend.

6. Use of operators new and delete.

7. Use of a namespace that you write (namespace std does not count).

8. Program Style (Comments, pre/post conditions, whitespace, indentation).

**THE DEADLINE FOR THIS IS NOVEMBER 17TH 2003 5PM. U.S MOUNTAIN TIME.**

## Platform

g++ compiler. the program must compile on a g++ compiler.

C Programming Engineering MySQL PHP Software Architecture Software Testing

Project ID: #3001510

About the project

19 proposals Remote project Active Nov 9, 2003

Awarded to:

lmxvw

See private message.

$11 USD in 14 days
(126 Reviews)
4.7

19 freelancers are bidding on average $27 for this job

mihaiscortaru

See private message.

$16.83 USD in 14 days
(159 Reviews)
6.0
scalaccio

See private message.

$34 USD in 14 days
(29 Reviews)
5.3
senzaciosnegyes

See private message.

$15.3 USD in 14 days
(104 Reviews)
4.9
herculesevw

See private message.

$13.6 USD in 14 days
(79 Reviews)
4.7
bolo30

See private message.

$23.8 USD in 14 days
(12 Reviews)
4.3
teamvw

See private message.

$25.5 USD in 14 days
(36 Reviews)
3.8
shashikhanvw

See private message.

$68 USD in 14 days
(15 Reviews)
3.8
rebuildingteam

See private message.

$17 USD in 14 days
(20 Reviews)
3.5
adam16

See private message.

$42.5 USD in 14 days
(13 Reviews)
3.3
kidronvw

See private message.

$6.8 USD in 14 days
(5 Reviews)
2.8
ciphereye

See private message.

$11.05 USD in 14 days
(16 Reviews)
2.7
kartanvw

See private message.

$11.05 USD in 14 days
(5 Reviews)
1.8
darkrainbowvw

See private message.

$6.8 USD in 14 days
(0 Reviews)
0.0
hofnoff

See private message.

$102 USD in 14 days
(1 Review)
0.0
shazamvw

See private message.

$4.25 USD in 14 days
(0 Reviews)
0.0
nav75

See private message.

$12.75 USD in 14 days
(3 Reviews)
0.0
kiduboy

See private message.

$23.8 USD in 14 days
(1 Review)
0.0
bassvw

See private message.

$71.78 USD in 14 days
(0 Reviews)
0.0