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 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
Craig keeps missing important staff meetings and getting double-booked for appointments. craig should use scheduling software a database diagramming software a word processor
Answers: 1
You know the right answer?
Create the class BigInt and overload the following operators: +

-

*
Questions
question
Mathematics, 21.05.2021 17:50
question
English, 21.05.2021 17:50
question
Mathematics, 21.05.2021 17:50
question
English, 21.05.2021 17:50
question
Mathematics, 21.05.2021 17:50