Giter Site home page Giter Site logo
  • πŸ‘‹ Hi, I’m @Abdelrahmanm22
  • πŸ‘€ I’m interested in web development and competitive programming
  • 🌱 I’m BackEnd Developer(php laravel)
  • πŸ“« You can reach me via my Email:[email protected]

Abdelrahman Mohamed's Projects

biginteger icon biginteger

Problem 1 [25 points] Different variations of types int and float exist in C++ and other languages. They are usually limited by minimum and maximum values. Sometimes it is desired to have versions of these types with unlimited bounds. Java solves this problem by providing BigInteger and BigDecimal classes. In this problem it is required to develop a new C++ type (class) that can hold unlimited decimal integer values and performs arithmetic operations on them. You will develop in C++ a class, BigInt that supports writing statements with extremely long integer values like these: BigInt num1("123456789012345678901234567890"); BigInt num2("113456789011345678901134567890"); BigInt num3 = num2 + num1; cout << "num1 = " << num1 << endl; CS214 – CAIRO UNIVERSITY - FCI – DATA STRUCTURES - 2022 / ASSIGNMENT 1 2 | P a g e cout << "num2 = " << num2 << endl; //236913578023691357802369135780 cout << "num2 + num1 = " << num3 << endl; Your task is: (1) Design the class BigInt that has the following public interface (set of operations available to use by developers using the class): [18 points, 3 points for each function] BigInt (string decStr); // Initialize from string and rejects bad input BigInt (int decInt); // Initialize from integer BigInt operator+ (BigInt anotherDec); BigInt operator= (BigInt anotherDec); Int size(); You will also need to overwrite the << operator as follows: friend ostream& operator << (ostream& out, BigInt b) Using data encapsulation, you are free to store the digits of the big decimal integer in whatever container you like. You might store them in an array, a vector, a string or whatever. These are details that are not important to the user of your class. You will need to build + and – operations that work on the representation you chose. (2) Implement the class BigInt and write five test cases (including –ve numbers) to test it. Implement a program that runs the test cases and verifies the result. [7 points, 2 for each test case and 2 for the class] (3) Name a folder β€œA1_P1_ID1_ID2” and put your files inside it (even if it’s only one file)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.