Find Jobs
Hire Freelancers

Add exception handling to this C++ program

$-1-4 USD

Fullført
Lagt ut omtrent 20 år siden

$-1-4 USD

Betalt ved levering
Add exception handling to this program. There are two possible errors inside the AddChar() routine. The "if" statements test for them. The try/catch block should be in the docalc() routine and should print an appropriate error message and let the routine continue and get the next number. class numberstring { enum {max = 40}; public: numberstring():length(0) {} void AddChar(char ch); bool AcceptableChar(char ch) {return ch >= '0' && ch <= '9';} int GetValue(); void Clear() {length = 0;} private: char buff[max]; int length; }; int numberstring::GetValue() { int accumulator = 0; for (int ii = 0; ii < length; ii++) accumulator = accumulator*10 + (buff[ii] - '0'); return accumulator; } void numberstring::AddChar(char ch) { if (AcceptableChar(ch)) if (length < max) buff[length++] = ch; } void docalc() { while (true) { numberstring n; char ch; do{ cin >> ch; [login to view URL](ch); } while (ch != '='); cout << [login to view URL](); [login to view URL](); } } ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment. b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Must work in Visual C++.
Prosjekt-ID: 3206269

Om prosjektet

2 forslag
Eksternt prosjekt
Aktiv 20 år siden

Ønsker du å tjene penger?

Fordeler med budgivning på Freelancer

Angi budsjettet og tidsrammen
Få betalt for arbeidet ditt
Skisser forslaget ditt
Det er gratis å registrere seg og by på jobber
Tildelt til:
Brukeravatar
See private message.
$1 USD om 1 dag
3,5 (2 omtaler)
0,0
0,0
2 frilansere byr i gjennomsnitt $2 USD for denne jobben
Brukeravatar
See private message.
$3,40 USD om 1 dag
0,0 (0 omtaler)
0,0
0,0

Om klienten

UNITED STATESs flagg
Reno, United States
5,0
78
Betalingsmetode bekreftet
Medlem siden okt. 9, 2002

Klientbekreftelse

Takk! Vi har sendt deg en lenke for at du skal kunne kreve din gratis kreditt.
Noe gikk galt. Vær så snill, prøv på nytt.
Registrerte brukere Publiserte jobber
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Forhåndsvisning innlasting
Tillatelse gitt for geolokalisering.
Påloggingsøkten din er utløpt og du har blitt logget ut. Logg på igjen.