1. Engineering
  2. Computer Science
  3. please help and please hurry below are the errors i...

Question: please help and please hurry below are the errors i...

Question details
PLEASE HELP AND PLEASE HURRY!!
Below are the errors I got on my code written in Linux. Please help me to solve my errors and rewrite my code if necessary. My code is at the bottom. Thank you
l Secure Shell Ele Edt yiew Wndow Heb Quick Connect Profies trom /ust/include/c++/4.8.2/ostream:38, rom usr/include/c++/4.8.2/iostream:39, from Rational.h:3, from Rational.cpp:4: /ust/include/c++/4.8.2/bits/locale facets.h:2449:32: error: åstreamsizeå has not been declared M pad (char_type till, streamsize w, ios bases io, In file included from /usr/include/c++/4.8.2/bits/locale facets.h:2608:0, from /usr/include/c+/4.8.2/bits/basic ios.h:37, from /usr/include/c++/4.8.2/1os:44, from /usr/include/c++/4.8.2/ostream:38 from /usr/include/c++/4.8.2/iostream:39, from Rational.h:3, from Rational.cpp:4: /usr/include/+/4.8.2/bits/locale facets.tcc:775:27: error: astreamsizeå has no t been declared M padCharT i1l, streamsize, ios bases i0 /usr/include/c++/4.8.2/bits/locale facets.tcc: In nenber functionutIter std: ueT) constå: /usr/include/c++/4.8.2/bits/locale_facets.tcc:916:8: error: åstreamsizeá does no t name a type const streansize -w = ーǐo.width(); /usr/include/++/4.8.2/bits/locale facets.tcc:917:6: error:å was not declar ed in th13 scope if Lw static castcstreamsizelen)) usr/include/c++/4.8.2/bits/locale facets.tce:917:24: error: expected type-speci fier before åstreansizeå it static castcstreamsize>(len)) /usr/include/c++/4.8.2/bits/locale facets.tcc:917:24: error: expected &>å before ástreassizea Connected to cloudland.kennesaw.edu O Type here to search
Ele Edt yjew Wndow Heb Quick Connect Profiles ust/include/c+/4.8.2/bits/locale facets.tce: 917:24: error: expected && before astreamnsize usr/include/c+/4.8.2/bits/locale facets.tce:917:24: error: expected à (á before astreamsizeå /usr/include/c++/4.8.2/bits/locale facets.tcc:917:24: error: astreansizeå was no t declared in this scope /usr/include/c+/4.8.2/bits/locale facets.tce:918:4: error: expected a) & before áià token /usr/include/C++/4 .ย. 2/bits/locale-facets. tce: In nerber function l-atter std: nm puts chart, utIters:insert float(utIter, std:sios pase&, hart, ch ar, ValueT) constá: /usr/include/c+/4.8.2/bits/locale facets.tee:979:8: error: ästreamsizeå does no t name a type const streansize prec- to.precision) <06: 1o.precision: /ust/include/c+/4.8.2/bits/locale facets.tcc:996:19: error: precå vas not de clared in this scope usr/include/c++/4.8.2/bits/1ocale facets.tcc:1054:6: error: ästreansizeå was no t declared in this scope streansize off -0: husr/include/C++/4 .ย.2/bits/locale-facets .tcc :1054:17: error : expected a:a befor streamsize ott-0 usr/include/c+/4.8.2/bits/locale facets.tcc:1057:3: error: ared in this scope ofti vas not dec /usr/include/c++/4.8.2/bits/locale facets.tec:1063:45: error: clared in this scope oftå was not de Connected to cloudland.kennesaw.edu Type here to search
media%2F235%2F235917fd-2efd-4d2e-a332-da
media%2Fe0a%2Fe0a73e97-3251-4844-85c0-8c
edu-default-SSH Secure Shell Ele Edit View Wndow Helb Quick Connect 」Profiles /usr/include/c++/4.8.2/ostream:313:8: error: åstreamsizeå does not name a type const streamsize put this-rdbuf0->sputns,) puta was not declared in this sc /usr/include/c+/4.8.2/ostream:314:6: error: ope /usr/include/c++/4 .ย. 2/ostrea : In function &sed: :basic-strean(harT, -rraits> & std: :operator<</std ::basic-stream<-TharT-Traits>4, const-harf.A: usr/include/c++/4.8.2/ostream: 519:17: error: expected type-specifier before åst reamsizeå static_castcstreamsize (Traits::lengtha))): /usr/include/++/4.8.2/ostream:519:17: error: expected á>å before astreamsizeå /ust/include/c++/4.8.2/ostream:519:17: error: expected á (å before astreamsizeå /usr/include/c+/4.8.2/ostream:519:17: error: åstreamsizea was not declared in t his scope /usr/include/c++/4.8.2/ostreaa: In function ástd: :basic-streacchar,-Traits std: :operator<< (std: :basic ostreamcchar, _Traits>s, const char.)&: /usr/include/c++/4.8.2/ostream:536:17: error: expected type-specifier before åst reansizeå tatic cast(streansize>(_Traits : :1engthu_s))); /usr/include/c++/4.8.2/ostream:536:17: error: expected á>à before åstreamsizeà /usr/include/c/4.8.2/ostream:536:17: error: expected à (å before istreamsizeå /usr/include/c++/4.8.2/ostream: 536:17: error: åstreamsizeå was not declared in t his scope In file included from /usr/include/c++/4.8.2/ostream: 612:0 from /usr/include/c++/4.8.2/iostream: 39, from Rational.h:3, from Rational.cpp:4: usr/include/c+/4.8.2/bits/ostream.tec: At global scope: /usr/include/c+/4.8.2/bits/ostream.tcc:183:30: error: åstreamsizeå has not been declared write (const CharT ,streamsize n) Connected to cloudland.kennesaw.edu O Type here to search
SSH Secure Shell Ele Edt Yiew Window Heb Quick Connect Profiles In file included from /usr/include/c++/4.8.2/1ostream:40:0, trom Rational.h:3, from Rational.cpp:4: /usr/include/c++/4.8.2/1stream: 82:7: error: astreansizeå does not name a type /usr/include/c+/4.8.2/1stream: 268:7: error: åstreamsizeå does not name a type streamsize /usr/include/o++/4.8.2/istream:343:27: error: åstreamsizeå has not been declared get (chaz_type, streamsize, char type delim): get (char_types, streamsize) getline (char_type, streamsizen, char type delim): getline (char_type , streamsizen) /usr/include/c++/4.8.2/istream:354:27: error: åstreamsizeå has not been declared /usr/include/c++/4.8.2/1stream:416:31: error: åstreamsizeå has not been declared usr/include/c++/4.8.2/istream: 427:31: error: åstreamsizeå has not been declared usr/include/c+/4.8.2/1stream: 451:7: error: expected &:å at end of member decla ration ignore (streamsizen, int type delim): /usr/include/C++/4 .8.2/1strean : 451:25: error: expected ája before l_- ignore (streamsize n, int. type delin): usr/include/c++/4.8.2/1stream: 454:7: error: expected &;å at end of member decla ration ignore (streansize n): ust/include/c++/4.8.2/istream: 454:14: error: redeclaration of åstd::basic istre hart, Traits>:istrear_types std::basic istreamK_harT, Traits>::ignore Connected to cloudland.kennesaw.edu Type here to search

media%2F5fe%2F5feb52ae-126e-49b9-96f8-ff
media%2F686%2F68672a22-5370-4829-bdf6-ed
media%2F2d0%2F2d0b7069-94a8-4a65-bb8b-e5
2 doudlond.kennesaw.edu-default SSH Secure Shell Ele Edt yiew Wndow Heb Quick Connect Lu Profies laration ignore (streansize n, int_type _delim) usr/include/c++/4.8.2/1stream: 451:14: note: previous declaration åstd::basic is treamochar_t>::--ist reaa_type std: :basic-istreano char-t> : : ignoreá usr/include/c++/4.8.2/1stream: 635:29: error: åstreansizeå has not been declared getline (char_type-s, streamsize, char_type delim) ust/include/c++/4.8.2/istream: 640:12: error: åstd::basic istreamevchar >&std: :basic_istreanowchar t>::ignoreå is not a static member of åclass std: :basic ist ignore (streansize ) ust/include/c+/4.8.2/1stream: 640:12: error: astreamsizeá vas not declared in t his scope /ust/include/c/4.8.2/stream: 645:12: error: åstd::basic istreamcchar t> std: :basic istreamcvchar t>::igmore& is not a static member of áclass std: :basic ist ignore (streamsizen, int type delim): ust/include/c+/4.8.2/1stream: 645:12: error: åstreansize was not declared in t his scope /usr/include/c+/4.8.2/istream: 645:37: error: expected primary-expression before delinå ignore (streamsize n, int type delim): usr/include/c+/4.8.2/1stream: 645:44: error: expression 1ist treated as compoun d expression in initializer-fpermissive] ignore (streamsizen, int_type de1im): In file included from /usr/include/c+/4.8.2/1stream: 882:0, fzom usr/include/c++/4.8.2/1ostream:40, from Rational.h:3, trom Rational.cpp:4: usr/include/c++/4.8.2/bits/istream.tec: In member function astd: :basic istrea harT.-Traits>: :int-type std: :basic-istreux harT,一rraitsn:get OA: onnected to cloudland.kennesaw.edu O Type here to search 다 994

Ele Edit Yew岦ndow Help 21 Quick Connect Profles usr/include/c+/4.8.2/bits/istrean.tce:248:7: error: 4 *zcountá vas not declar ed in this scope st/include/c+/4.8.2/bits/istrean.tcc: In member function ástd: basic istreanc /u CharT, Fraitas std::basic istrean hart, Traits>::get (std::basic harT, Traits>::char_type6) &: usr/include/C++/4.8.2/bits / istrean.tcc : 282:7: error: İ.0counta was ed in this scope istrean ust/include/c+/4.8.2/bits/istream.tec: At global scope: usr/include/c++/4.8.2 declared /bits/istream.tcc:317:25: error: ästreamsizeå has not been get (char_type, streamsize, char_type delim) ::basic istream :basic_ istrean_a 一rraits> ::char-type) /usr/include/c/4.8.2/bits/istream.tec: In member function åstd harT, Traits>i std: :basic istreamhart, Traits>: :get (std: usr/include/c++/4.8.2/bits/istream.tcc:319:7: error: countá vas not declar usr/include/c+/4.8.2/bits/istream.tcc: In member function åstd::basic istreamc harT, -Traits>: :char-type., int, std:basic-istrean.hart, ล์: ed in this scope M gcount -0: T, Traits>s std::basic istrean charr, Traits>: :get (std: :basic istreaas harT, 一rratan:-treambaf-type, std: basic-istrean-harT. -traits: :char-typ usr/include/+/4.8.2/bits/istream.tee:366:7: eror: xcountá was not declar ed in this scope M.gcount usr/include/c++/4,8.2/bits/istream.toc: At global scope: usr/include/c++/4.8.2/bits/istream.toe:408:29: error: åstreansizeå has not beern declared getline (char type s, streamsize , char_type de1im) Connected to cloudland.kennesaw.edu O Type here to search
Ele Edt View Window Heb 2) Quick Connect Profies usr/include/c++/4.8.2/bits/istream.tcc: In member tunction ástd: :basic_istream harT.-rraits56 std: :basic-istrean<コarT_rraits> ::getline (std: :basic-istrea int, std::basic-istreak-harf, -traits>::char-t ธ<ー:har, -Traits> : :char-type*, /usr/include/c++/4.8.2/bits/istream.tcc:410:7: error: zcountá vas not declar ed in this scope usr/include//4.8.2/bits/istream.tcc: In member function åstd: :basic ist chart, Traits>s std: :basic istreank har, Traits::ignore )& usr/include/c++/4.8.2/bits/istream.tee:470:7: error: countá vas not declar ed in this scope reamc M gcount-0 /ust/include/c+/4.8.2/bits/istream.tec: At global scope: usr/include/++/4.8.2/bits/istream.tee: 501:12: error: åstd: :basic istrean Char T, Traitsos std: :basic istreamharT, Traits>::ignoreá is not a static member of åclass std: :basic istrean har, Traits>i ignore (streamsize usr/include/c++/4.8.2/bits/istrean.tee:501:12: error: template n-template &std: :basic istrean.コart,ーrraïts std: :basic-istrean<-コart, its>::ignore à -rra stream.tcc:501:12: error: astreamsizeá was not decl ared in this acope /usr/include/+/4.8.2/bits/istream.tcc:563:12: error: åstd::basic istream< har т, rrai ta56 std : :basic-is trean..harT, -Trai ta> ignored is not a static member - aclass, std:basic-istrean..harT, -raits>& of ignore (streamsize , int_type -delim) usr/include/s+/4.8.2/bits/istrean.tce:563:12: error: template detinition of no n-template ástd: basic-istrean< harT,-Traits> std: :basic-istreak hart,-rra its>::ignore& /usr/include/c++/4.8.2/bits/istream.tec:563:12: error: åstreansizeå vas not decl ared in this scope Connected to c Type here to search
J cloudland.k Ele Edt yew Wndow Heb edu-default-SSH Secure Shel Quick Connect Profies on before deliå ignore (streamsize n, int_type delim) /usr/include/c++/4.8.2/bits/istream.tce: In menber function åstd: :basic istrean harT,-traits> : : int type std ::basic Lstrean< arT, /usr/include/C++/4 .ย. 2/bits/ist reaa.tcc : 631 :7 : error: ed in this scope -rraita> : :peek ( ) a: í.Jcounta was not declar usr/include/c++/4.8.2/bits/istream.tce: At global scope: /usr/include/c++/4.8.2/bits/istream.tce: 658:26: error:ástreamsizeá has not been declared read (char_type, streamsize n) /usr/include/c++/4.8.2/bits/istream.tec: In member function åstd: :basic istrean hart,-traits std: basic-Lstrean<コarT.-rraits> :: read (std: :basic-istrear CharT,-Traits> ::char type., intid: /usr/include/C++/4.8.2/bits/is treaz. tcc :660:7: error: it7count&was not declar ed in this scope usr/include/c++/4.8.2/bits/istream.tec: At global scope: usr/include/c+/4.8.2/bits/istream.tcc: 685:5: error: åstreansizeå does not name a type streansize /usr/include/c+/4.8.2/bits/istream.toc: In member function astd::basic istreanc hart, Traitsss std::basic_istreaa harT,Traits>: :putback (std::basic istrea usr/include/c+/4.8.2/bits/istream.toc:723:7: error:countá was not declar ed in this scope H.gcount -0F usr/include/c++/4.8.2/bits/istream.tcc: In member function åstd: :basic istreanc usr/include/c++/4.8.2/bits/istream.toc:758:7: error:& countá vas not declar Connected to cloudland.kennesaw.edu Type here to search 討 99+
doudland.kennesaw.edu -default-SSH Secure Shell Ele Edit Yew ydow Help Quick Connect Profiles /ust/include/c+/4.8.2/bits/istream.tcc: In function åstd: :basic istream har, Traits> std: :operator» (std:basic-istrean.TharT, /ust/include/c++/4.8.2/bits/istream.tcc:971:7: error: 一rraïts,-harma: åstreamsizeå was not decla zed in this scope streansize extracted - 0: /usr/include/c++/4.8.2/bits/1strean.tec : 971:18: tracted expected &:ā before a--,x error: streamsize extracted - 0: usr/include/c+/4.8.2/bits/istream.tcc: 979:19: error: expected à:å beforeau streamsize u in.width): /ust/include/c+/4.8.2/bits/istream.tec:980:12: error: in this scope vas not declared num0) /ust/include/c++/4.8.2/bits/istream.tee:981:49: error: type/value mismatch at ar gument 1 in template parameter list for &templatecclassalue> struct nuneric traitså nm-u cxcx: nuneric traitscstreamsize>::ax /usr/include/+/4.8.2/bits/istream.tcc:981:49: error: expected a type, got ás treansizeà ust/include/c/4.8.2/bits/istream.tce:989:15: error: xtractedá was not dec lared in this scope while Lextracted <-num-1 /usr/include/c+/4.8.2/bits/istream.tce:989:29: error: numå was not declared in this scope while (-extracted < num-1 usr/include/c++/4.8.2/bits/istream.toc:1014:12: error: extractedá was not de clared in this scope onnected to cloudland.kennesaw.edu 0 Type here to search
1 rational_test.cpp: 3 #include Rationalh 5 int main) Rational xi x.printRational (); Rational y (4, 5); Rational zy 8 10 x=y; 12.printRational) 13 14 15 16 17 18 19 20 21 y.printRational (): z.printRational (); Rational rl (3, 8) Rational r2 (1, 6); Rational r3 (1, 2) Rational r4 (2, 5) (rl r2).printRational ) (r3 r2) printRational ); (rl r4) printRational ) (rl r2) printRational (); 23 24 25

l Rational.h: 3 #include <iostream» 5 using namespace std: 7 class Rational // not fully commented public: Rational (int, int) // parameterized constructor Rational) I default constructor Rational (const Rational &x) // copy constructor .2 し3 14 し5 Rational operatort (const Rational); Rational operator- (const Rational); Rational operator (const Rational) Rational operator/ (const Rational); Rational operator-(const Rational) 17 18 19 20 21 void printRational (): private: 23 24 int numerator: int denominator: void reduce ): 1/ utility function, reduce to lowest terms 25
1 Rational.cpp: 2 3 4 tinclude Rational.h 6 7 // if t 8 Rational: :Rational (int n, int d) t he number is negative, the negative is always stored in the numerator numerator= (d < 0 ? -n : n); denominator (d < 0 ? -d : d); reduce () 10 12 ) 13 // default constructor: 14 Rational: :Rational) ( 15 16 denominatorii 17 1 18 // copy constructor 19 Rational: :Rational (const Rational &x) { 20 21 numerator 0; numeratorx.numerator denominatorx. denominator reduce () 23) 24 25 Rational Rational::operatort (const Rational a) t

5 Rational Rational::operatort (const Rational a) ( 6 27 28 9 t.reduce ) 30 31 1 32 Rational ti t.numerator a.numerator den t.denominator a.denominator denominator return t: 34 Rational Rational::operator-(const Rational a Rational t: 35 36 37 38 39 40 41 t.numerator -a.numerator denominator a.denominator numerator t.denominator a.denominator denominator: t.reduce ); return t: 42 43 44 Rational Rational::operator (const Rational a) ( Rational t; 45 4 6 47 4 8 t.numerator a.numerator numerator: t.denominator a.denominator denominator t. reduce ); 49 returnti
50 1 51 52 53 54 Rational Rational::operator/ (const Rational a) t Rational t; t. numerator a.denominator numerator; t·denominator=a.numerator * denominator; t.reduce ); 56 57 58 1 59 rturn ti 60 1 61 62 63 void Rational::printRational) 64 65 if (denominator1) cout << numerator << endl; else ( tr 67 cout << numerator << / << denominator << endl: ac 68 et et ro 69) 70 71 r72 Rational Rational::operator-(const Rational x) ( 73 74 numerator x.numerator denominatorx.denominator
75 76 reduce (O; return *thisi 78 79 80// reduce Rational to lowest terms 81 void Rational: :reduce) I 82 83 84 85 int gd 0: // greatest common divisor int n numerator <0 ?-numerator numerator int d-denominator int largest n d? nd 86 87 for (int loop largest: loop 2: loop--) if (numerator % loop-O && denominator % loop-0) { gcd -loop: break; 89 90 91 92 93 94 95) if (gcd # 0) { numerator /= gcd; denominator / gcd;
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution