Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I attached bigint.h, main.h, main.cpp,and makefile. I need bigint.cpp file. I attached below example string.h and string.cpp file. Please make it the bigint.cpp file like

I attached bigint.h, main.h, main.cpp,and makefile.
I need bigint.cpp file. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
I attached below example string.h and string.cpp file.
Please make it the bigint.cpp file like string.cpp file that I attached below.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The Bigint class represents arbitrarily large integers (values larger than can be supported with unsigned lonq long int data types) as C++ strinq objects, and supports addition of these alues. Here is a sample of proqram output: [ile main.cpp compiled using CNU CCC 7.2.0 with 32 bit integers [] bigint.h ['1 main.h [' main.cpp [) makefile Mid-Term: Big Numbers! Author: 4. i Version: 1.0 5 6 7 #pragma once 9 10 / System Libraries 11 #includechrono 12 #include 14 #include 15 #includecassert 16 #include exception> 17 #include/cctype> 18 #include 19 #include cmath 20 #include 22 #include stream> 23 #includedomanip> 24 #include Time utilities Limits t Limits /A Assertions Exceptions Chani type dato String Clas Stondard string sto Formatt ing 26 class Bigint 27E 28 29 30 31 32 public: // Six Pack Bigint()5 Bigint (std: :string) Bigint(const Bigint &) Bigint (Bigint &&) Bigint & operator (const Bigint &)5 Bigint & operator (8igint 88)3 Defoult Constructor Parm constructur Copy Constructor / Move Constructor /l Copy assignment /ove Assignment 34 36 Bigint) Destructor // Input and output friend std::ostream & operator > (std:: stream &, Bigint &); const Bigint a) / Relationol friend bool operator 11 #includefloat 12 #include 13 #include 14 #include 15 #include 16 #includestring> 17 #include 18 #include 19 #include 20 #includesstream> Time utilities Limits // Limits MLimits MAssentions 11 Exceptions char ype data Cr String lass Math routines A Standand Streoms File stream Staing streams AR s 21 22 23 #includeomanip> #include Formatting Regutarl expresHEtons 24 25 26 Project Libraries #include "bigint"h" 27 / Function Declarations 28 int main(int, char*) 29 Weinfunctio I'] bigint.h I'1 main.h '] main.cpp I'] makefile 2 File Name: main.cpp 4 5 6 Purpose:Implementation file for main module Author Version: 1.e #include-main.h" // header file for this module 8 9 Function Definitions 10 int main(int argc, char *argv) 11 { / We 'LL start with a compile stamp just to show a bit of the compiler macros | std: : cout > var_a > var b / Display result // ALL done return e 34 35 bigint.h ] main.h [] main.cpp [1 makefile # Log file name 2 LOG-log # Executable name 5 EXEC-main 6 # Create the course code file list 8 SOURCES-$(wildcard.cpp) 9 HEADERS-$(wildcard h) 10 11 # compiler options 12 cc-g++ 13 FLAG--g -std-c++11 -Wall 14 15 # Make targets 16 all: 17 (EXEC) 18 CEXEC): $(SOURCES)S(HEADERS) 19 20 21 22 clean: 23 24 @rm-f $(LOG) es (CC) S(FLAGO SKEXEC) S (SOURCES) 8835 .00 432 rm f (EXEC) $(LOG) lasses Debug bigint.h main.h main.cpp add.cpp makefile main.h main.cpp s162hdr.h 162hdr.cpp ANSWER KEY st 1 VI Mid- Term CLass Declarati 2 #pragma once #include #include donanP> 6 class String public: String) String(char) String(const String &) String(String &8) string) 10 12 13 14 15 16 17 18 19 String & operator- (const String &)) String & operator (String &) size t length) size t capacity) char push(char)j 21 pop) rpnd(char )i 23 rat s cee 25 26 27 28 friend stdr sistran 8 oprator (stdi istreen &, String 8) private: char data(1800] size t size sizet max 31 L 32 E stringh Dbug higinth minh maincpe addcpp matefile mainh maincpp 6s16chdsh stichd.pp ANEREYting p sting h Debug 1 include "string.h" 3 sizet String::length() ( return sizes 4 size t String::capacity) ( return maxj char String::append(char byte) ( if (size(max 1)) ( data[size] byte 1e return byte 12 13 E char String: :pop) ( 14 15 16 for (idx-e; idx 17 18 19 2e 21 char result data[e] int idx -e static-castcintx(size- 1)); idn++) { datalidx] data[idx 1 data[-size]es return result 23 E char String: push(char 24 25 26 27 28 29 3e 31 32 33 string: String() { byte) if (size > (std:: 93char byte; stream & in , String & parm) ( 94 while (in-Peek() != "in') { 95 96 97 98 byte in.get()s parm.append (byte) return in 100 101std::ostream & operator 14 #include 15 #includecassert 16 #include exception> 17 #include/cctype> 18 #include 19 #include cmath 20 #include 22 #include stream> 23 #includedomanip> 24 #include Time utilities Limits t Limits /A Assertions Exceptions Chani type dato String Clas Stondard string sto Formatt ing 26 class Bigint 27E 28 29 30 31 32 public: // Six Pack Bigint()5 Bigint (std: :string) Bigint(const Bigint &) Bigint (Bigint &&) Bigint & operator (const Bigint &)5 Bigint & operator (8igint 88)3 Defoult Constructor Parm constructur Copy Constructor / Move Constructor /l Copy assignment /ove Assignment 34 36 Bigint) Destructor // Input and output friend std::ostream & operator > (std:: stream &, Bigint &); const Bigint a) / Relationol friend bool operator 11 #includefloat 12 #include 13 #include 14 #include 15 #include 16 #includestring> 17 #include 18 #include 19 #include 20 #includesstream> Time utilities Limits // Limits MLimits MAssentions 11 Exceptions char ype data Cr String lass Math routines A Standand Streoms File stream Staing streams AR s 21 22 23 #includeomanip> #include Formatting Regutarl expresHEtons 24 25 26 Project Libraries #include "bigint"h" 27 / Function Declarations 28 int main(int, char*) 29 Weinfunctio I'] bigint.h I'1 main.h '] main.cpp I'] makefile 2 File Name: main.cpp 4 5 6 Purpose:Implementation file for main module Author Version: 1.e #include-main.h" // header file for this module 8 9 Function Definitions 10 int main(int argc, char *argv) 11 { / We 'LL start with a compile stamp just to show a bit of the compiler macros | std: : cout > var_a > var b / Display result // ALL done return e 34 35 bigint.h ] main.h [] main.cpp [1 makefile # Log file name 2 LOG-log # Executable name 5 EXEC-main 6 # Create the course code file list 8 SOURCES-$(wildcard.cpp) 9 HEADERS-$(wildcard h) 10 11 # compiler options 12 cc-g++ 13 FLAG--g -std-c++11 -Wall 14 15 # Make targets 16 all: 17 (EXEC) 18 CEXEC): $(SOURCES)S(HEADERS) 19 20 21 22 clean: 23 24 @rm-f $(LOG) es (CC) S(FLAGO SKEXEC) S (SOURCES) 8835 .00 432 rm f (EXEC) $(LOG) lasses Debug bigint.h main.h main.cpp add.cpp makefile main.h main.cpp s162hdr.h 162hdr.cpp ANSWER KEY st 1 VI Mid- Term CLass Declarati 2 #pragma once #include #include donanP> 6 class String public: String) String(char) String(const String &) String(String &8) string) 10 12 13 14 15 16 17 18 19 String & operator- (const String &)) String & operator (String &) size t length) size t capacity) char push(char)j 21 pop) rpnd(char )i 23 rat s cee 25 26 27 28 friend stdr sistran 8 oprator (stdi istreen &, String 8) private: char data(1800] size t size sizet max 31 L 32 E stringh Dbug higinth minh maincpe addcpp matefile mainh maincpp 6s16chdsh stichd.pp ANEREYting p sting h Debug 1 include "string.h" 3 sizet String::length() ( return sizes 4 size t String::capacity) ( return maxj char String::append(char byte) ( if (size(max 1)) ( data[size] byte 1e return byte 12 13 E char String: :pop) ( 14 15 16 for (idx-e; idx 17 18 19 2e 21 char result data[e] int idx -e static-castcintx(size- 1)); idn++) { datalidx] data[idx 1 data[-size]es return result 23 E char String: push(char 24 25 26 27 28 29 3e 31 32 33 string: String() { byte) if (size > (std:: 93char byte; stream & in , String & parm) ( 94 while (in-Peek() != "in') { 95 96 97 98 byte in.get()s parm.append (byte) return in 100 101std::ostream & operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions