(Solved) : Include Using Namespace Std Void Stats String Str Von Wn Int Avg 0 Int Num 0 String Word I Q44170787 . . .
C++ Program Fix the errors in the lines



#include <iostream> using namespace std; void stats (string str) von WN int avg=0; int num=0; string word =””; for (int i=0;i<str.length();i++) { char x=str[i]; if (x == 1 ) 8 9 10 avg=avg+word.length(); num ++; else POGOS word= word + x; avg-avg-word.length(); num- L . O OCCO else TD word, word + x: avg-avg+word. length(); num++ cout<<“Average length of word is “<<< (double) avg/ (double) num cout<< “Number of words are: <<num<< endl; kendi int main() strings: cout<<“Enter string: getline (cin, s); int v=0, 0, num, avg: for (int i 0:1 s.length 0:1–> if( (3 (1) 66311 3 si 669 (1) Logs & others in Code::Blocks Search results hcccc Buildloge Build messages pocheckera File – Build Debug in Asiqmentspiler GNUGGC Complex In sinton ved E ing CENUSESNVES – Copa 2 . R OLE COOQQSC Lepp X 27 strings: cout<<“Enter string: getline (cin, a): int v0,6-0, num, avg: for (int i=0;i<3. length():14) } ((a[1]>-‘A’68[1]<=’Z’) ([1]>’a’ a[1]<-‘Z’)) 1 -1’111) 01811- 8 [1] 11- if(a[1]-=’alla[i]-‘ells[i “I’ [1] TO U ) cout<<“Number of vowels are.” cout<<“Number of consenta are: stata (s) : return 0; apex Chederea rochedVert s & others X Coc XI Search results Muldog x1 Build messages 1 Code::BlodsX Line Message ат. – Build: Debug in Assigment 7 (compiler: CWU CC Compiler) – In function “void statsistatu s tingi warning: comparison between signed and unsigted e r aprovados 1-Baign-campur In function in main Warning: comparison between signed and m ed integer pos t -opers Windows (CRLF) WINDOWS-1252 Line & Col 18 Pos 141 :UsersJorge. UsersJorge.. C:UsersJorge.. UsersJorge Insert Read/Write . 4 deut ENG w * C/C++ a n cpP o B e cout<<“Number of consonents are: “<<c<<endl; stats (3): return 0; Logs & others Code::Blocks X1 9 Search results x Corc Buld logx B uild messages x Copched Nerat+ X copCheckera ++ messe Message File Line C:UsersJorge C:UsersJorge. C:UsersJorge. C:UsersJorge… C:UsersJorge … 30 In function ‘void stats (std::__cxx11::string) Warning: comparison between signed and unsigned Integer expressions [-Waign-compare) In function ‘int main()’: varning: comparison between signed and unsigned integer expressions -Waign-compare varning: unused variable Trust – unused-variable C/C++ Windows (CR+LF) WINDOWS-1252 Line 8 Col 18, Pos 141 Insert ent7main.cpp Re search o e a Saw hp – “pit se cout<<“Number of vowels are:”<<v<<endl; cout<<“Number of consonents are: “<<c<<endl; stats(s) : return 0; Logs & others Code::Blocks C:UsersJorge C:UsersJorge C:UsersJorge C:UsersJorgo X Search results X Case X Build log x Build messages X CopCheck Nera++ x Copched Line Message In function ‘int main()’: varning: comparison between signed and unsigned integer expressions (-sign-comparoj varning: unused variable num’ [-Yunused-variable) varning: unused variable avg’ – unused-variables === Build finished: 0 erroris), 4 warning(s) (0 minute(s), o second(s)) C/C++ Windows (CRLF) WINDOWS-1252 Line 8, Col 18, Pos 141 Insert ssigment7main.cpp re to search to Be a $50 hp Show transcribed image text #include using namespace std; void stats (string str) von WN 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) von WN int avg=0; int num=0; string word =””; for (int i=0;i…
OR