subject

Create the class BigInt and overload the following operators: +

-

*

!

==

>=

>

<=

<

++ (pre/post)

-- (pre/post)

<<

>>

Question:Support a constructor that creates the big int given a vector of digits (int or char), a C array of characters and a size. The idea is to create class that can take any size of integer by keeping the individual digits in a a vector

1) if two numbers are given like A={20}, B={220,}, A+B Should be {240}

2)for >> operator the function should take the whole integer as ascii string

create class to represent large integers

3) the result of any operation should lead to another valid bigint not to an invalid vector

4)For ! operator:

!0 = true
!1 = false
!19999999999 = false
So no, this does not make negative numbers positive, it is true only if argument is zero

5)

- BigInt is a class where we represent big integers using "vector "?>the integer 12345 is represented as vector={1, 2, 3, 4, 5}

6)The char given must be an ASCII digit (exception negative sign). This should be a precondition in THE code and must be verified and error must be conveyed to the user.

7)For negative numbers, the input C char array (char[]) will have something like this {'-', '1', '2'}

8)So the class is not the one accepting input but constructors of the class. notice that it needs 3 types of special constructors: one that takes a vector of int digits, one that takes a vector of char digits and one that takes a C array of characters and the size.

You must support negative numbers: on a char array it is trivial how to do it: '-' must appear before a negative number, when using a vector with integers you can use negative integer to represent the sign at the start of the big int.

Please do it in c++ and also maintain 3 files.. BigInt. h,BigInt. cc(implementation) and main. cc( this contains main function)

main. cc is given below. Do not attempt to make any changes in main. cc .Check if the code is working for all the scenarios in main. cc. All that you need to implement is ,BigInt. cc(implementation file) and BigInt. h(header file)

main. cc:

#include "BigInt. h" /* Your own header file */

#include

#include

using namespace std;

int main(int argc, const char * argv[]){

vector integerVector;

integerVector. push_back(2);

integerVector. push_back(1);

integerVector. push_back(0);

vector charVector;

charVector. push_back('2');

charVector. push_back('1');

char charArray[] = {'1', '0'};

BigInt A = BigInt(integerVector);

cout<<"A = "<< A< B? : " <<(A>B)< =D? : " <<(A>=D)<
cout<<"Is C<=D? : " <<(C<=D)<
cout<<"Post Increment A by 1: " <
cout<<"Post Decrement A by 1: " <
cout<<"Pre Increment A by 1: " <<++A<
cout<<"Pre Decrement A by 1: " <<--A<
cout<<"What is ! of (A-D)? "<

return 0;

}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
This first part of the film shows the early history of motion pictures. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theatre productions? explain. in the scene where don is going to the party (starting at time code 14: 51), we see a street scene as he first rides with cosmo and then with kathy. what aspects did the filmmaker include to make the scene look and feel like don, cosmo, and kathy are riding in a car on a street? think about elements such as scenery, sound, props, lighting, and so on. a "talkie" picture is shown starting around time code 21: 15. how does the audience in the film react to the "talkie"? what influence do audiences have on film and theatre performances? how do film and theatre actors influence audiences? in the musical scene with cosmo (starting at time code 27: 00), how does the actor use props? what is the result? do you think the use of props effectively fulfilled the artistic vision for this musical number? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
You know the right answer?
Create the class BigInt and overload the following operators: +

-

*
Questions
question
Mathematics, 30.09.2019 12:10
question
Biology, 30.09.2019 12:10
question
Mathematics, 30.09.2019 12:10
Questions on the website: 13722361