(Solved) : Include Using Namespace Std Void Stats String Str Int Avg 0 Int Num 0 String Word Int 0 Q43984529 . . .
C++ Fixed the error in the lines




#include <iostream> using namespace std; void stats (string str) int avg=0; int num=0; string word =””; for (int i=0;i<str.length(); i++) { char x=str[i]; if x avg-avg+word. length 0 : num else word word = x; avg-avg-word. length Logs & others Code::Blocks Search results CCCCX Build log Build messages Copcheg Line Message Blocks 17.12 et Build Debug Fortran ww Smith Tools Tools Plugins DexyBlocks Settings Help stabftragst) vod D 4 . 2. IACOBSC LEPP X avg-avg word.length(): cout<<“Average length of word is “<<(double) avg/ (double cout<<“Number of worda are: ccnum endl; int main() strings: cout<<“Enter atring: “; getline (cin, 3); int v=0.0-0, num, avg: for (int 10:1 3.length():1++) ) 11 (1) 12 555 011 if(([1]>-A6311Z 11 (51)- T81) –‘ 18[1] — 111011011 111-’13 (1)- 11- 18 11- 18 11-0) else C++; es & others Coco Code::Blocks X Search results X Coex Buldog Bulld messages X CopChedera ++ X CopChecker++ messages X ale Line Message – Build: Debug in Assigment 7 (compiler: GTU CCC Compiler) – UsersJorge… In function ‘void statsistd::_ e s tring): Oorsi Jorgo … 9 varning: comparison between signed and magned integer expressione Waign-compare UsersJorge… 20 error: expected initializer before ‘sering’ UsersJorge 30 error was nos declared in this scope C/C++ Windows (CR+LF) WINDOWS-1252 Line 28, Col 18, Pos 578 Insert Read/Winte o in • PP de aut Blocks 17.12 Build Debug Fortan Smith looks Look Plugins DexyBlocks Setting up 2. ODDSCE getline (cins) int 0,6-0,num, avg for (int 1-0:1 .length() i++) 10 (5[1]> A [ 1 2 “) 63[112 ) als[1] [1] – 10 (1) VH+; else C++: 3111- 12 – > cout<<“Number of vowels are covecend cout<<“Number of consonants aret”. cc stats (a) return 0; & others X Corched e erat x Deb Code::Blocks X Search results X Cock X Build log Build messages X CopChedNeat Lane Message – Build: Debug in Assiqment 7 (compiler: GU GCC Compiler) UsersJorge… In function ‘void stats (std::_ 0x11::string: UsersJorge varning: comparison between algned and unsigned integer expressions son UsersJorge… 20 error: expected initialiter before ‘string’ UsersJorge 30 error: ‘s’ was not declared in this scope C/C++ Windows (CR+LF) WINDOWS-1252 Line 28, Col 18, Pes 578 Read/Writt default ho Logs & others Code::Blocks X Search results X COCCX Build log X Build messages x CppcheckIera++ X File Line Message C:UsersJorge. In function “void statsistd::_excelstring) C:UsersJorge 9 Warning: comparison between signed and unsigned integer expression – On-compare C:UsersJorge… 20 Orror: expected initializer before string C:Users Jorge tors’ was not declared in this scope CHAUSSES Jorge 3 Zor zedeelaration of an mentTmain.cpp Windows (CR-LF) WINDOWS-1252 Line 28, Col 18. Pos 578 Insert to search C/C++ ар) Logs & others Code::Blocks X Search results X COCCX Build log X Build messages X CopCheckeratt SITE Line 31 CUSOTSJorge… C:UsersJorge ONUsersJorge C:UsersJorge Message error: redeelaration of int num note: Tint num’ previously declared here erroredeclaration of ‘int avg note: ‘int avg’ previously declared heze Bus id failed: 4 ro l warning ( 10 minute(s), 0 seconds) C/C++ Windows (CRLF) WINDOWS-1252 Line 28, Col 18 Pos 578 6 gment main.cpp e to search …. …………….. ………………… . Code::Blocks X Search results X CCCCX Build log X Build messages X Cppcheck/Vera++ X File Line C:UsersJorge… 7 C:UsersJorge… 31 C:UsersJorge… E C:UsersJorge… 45 Message note: ‘int num’ previously declared here error: redeclaration of ‘int avg” note: ‘int avg’ previously declared here error: return-statement with a value, in function returning ‘void’ [-fpermissive] – Build failed: 5 error(s), 1 warning(s) 0 minute(s), o second(s)) – C/C++ Windows (CR+LF) WINDOWS-1252 Line 28, Col 1, Pos 561 enti main.cpp Inse search o e a UW H Show transcribed image text #include using namespace std; void stats (string str) int avg=0; int num=0; string word =””; for (int i=0;i
Expert Answer
Answer to #include using namespace std; void stats (string str) int avg=0; int num=0; string word =””; for (int i=0;i…
OR