C++ Programming

Create the class BigInt and overload the following operators:


Don't use plagiarized sources. Get Your Custom Essay on
C++ Programming
Just from $13/Page
Order Essay








++ (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


– BigInt is a class where we represent big integers using “vector<int>”?—–>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)





#include “BigInt.h” /* Your own header file */

#include <iostream>

#include <vector>

using namespace std;

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

vector<int> integerVector;





vector<char> charVector;




char charArray[] = {‘1’, ‘0’};


BigInt A = BigInt(integerVector);

cout<<“A = “<< A<<endl;


BigInt B = BigInt(charVector);

cout<<“B = “<<B<<endl;


BigInt C = BigInt(charArray, 2);

cout<<“C = “<<C<<endl;


BigInt D = B*C;


cout<<“D = “<<D<<endl;


cout<<“A+B = “<<A+B<<endl;

cout<<“B-C = “<<B-C<<endl;



cout<<“A is equal to D “<<A<<endl;


else {

cout<<“Ais not equal to D”<<endl;



cout<<“Is A>B? : ” <<(A>B)<<endl;

cout<<“Is B<C? : ” <<(B<C)<<endl;

cout<<“Is A>=D? : ” <<(A>=D)<<endl;

cout<<“Is C<=D? : ” <<(C<=D)<<endl;

cout<<“Post Increment A by 1: ” <<A++<<endl;

cout<<“Post Decrement A by 1: ” <<A–<<endl;

cout<<“Pre Increment A by 1: ” <<++A<<endl;

cout<<“Pre Decrement A by 1: ” <<–A<<endl;

cout<<“What is ! of (A-D)? “<<!(A-D)<<endl;


return 0;


Academic Heros
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

Our writers are encouraged to read and research widely to have rich information before writing clients’ papers. Therefore, be it high school or PhD level paper, it will always be a well-researched work handled by experts.

Professional and Experienced Academic Writers

For one to become part of our team, thorough interview and vetting is undertaken to make sure their academic level and experience are beyond reproach, hence enabling us give our clients top quality work.

Free Unlimited Revisions

Once you have received your paper and feel that some issues have been missed, just request for revision and it will be done. In addition, you can present your work to the tutor and he/she asks for improvement/changes, we are always ready to assist.

Prompt Delivery and 100% Money-Back-Guarantee

All our papers are sent to the clients before the deadline to allow them time to review the work before presenting to the tutor. If for some reason we feel our writers cannot meet the deadline, we will contact you to ask for more time. If this is not possible, then the paid amount will be refunded.

Original & Confidential

Our writers have been trained to ensure work produced is free of plagiarism. Software to check originality are also applied. Our clients’ information is highly guarded from third parties to ensure confidentiality is maintained.

24/7 Customer Support

Our support team is available 24 hours, 7 days a week. You can reach the team via live chat, email or phone call. You can always get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

You have had a hectic day, and still need to complete your assignment, yet it is late at night. No need to panic. Place your order with us, retire to bed, and once you wake up, the paper will be ready.


Essay Writing Service

It does not matter the urgency of your paper, or the academic level, our team is ready to help you 24/7. Just contact us and all your academic needs will be sorted.


Admission Essays & Business Writing Help

A student is often required to write an admission letter requesting to be admitted in a certain institution. For you to be gain that admission in your dream institution, you must write a convincing letter. You can depend on our team for the best admission letters.


Editing Support

Academic writing is not just about getting information and throwing it all over. Our team will ensure you have a polished paper that is coherent and has a good flow of information. We also ensure the paper follows the correct formatting styles like APA, Harvard, MLA, Chicago/Turabian.


Revision Support

If our writers write a paper but you are not satisfied in one way or another, you can always ask for revision. This is totally free. Our writers and editors will revise your paper untill you are be totally satisfied. We as well offer revision for papers not done by our writers at a small fee.