This is a basic idea :
Change variables!!
#include <iostream>
#include <string>
using namespace std;
const int N = 20;
// determines number of upper case and lower case words and deternmining
// sum of all of them
int determineNumberUpAndLow (string sent, int a[N][2],int sumU,int sumL)
{ int i,j;
int length,Upcount,Lcount;
cout << "Enter in a sentence: ";
getline(cin, sent, '\n'
;
length=sent.size();
Upcount=0;
Lcount=0;
sumU = 0;
sumL = 0;
cout<<"the length is " <<length;
// initialise all elements in array to 0
for (int i = 0;i <= length; i++)
{ for (int j = 0;j <= length; j++)
a
[j] = 0;
}
// main test operation
for (int i = 0;i <= length; i++)
{
if ((sent == 'A' || (sent== 'E' || (sent== 'I' || (sent== 'O' || (sent)=='U'
{ (Upcount=Upcount+1);
a[1] = Upcount;
sumU = a[1] + sumU;
}
if ((sent == 'a' || (sent== 'e' || (sent== 'i' || (sent== 'o' || (sent)=='u'
{ (Lcount=Lcount+1);
a[2] = Lcount;
sumL = a[2] + sumL;
}
}
/*for (int i = 0;i <= length; i++) ---> to test contents of array a
{ for (int j = 0;j <= length; j++)
{ cout<<a[j];
}
cout<<endl;
}*/
cout<<"sumU is "<<sumU<<" sumL is "<<sumL<<endl;
cout<<"number of upper case vowels"<<Upcount<<endl;
cout<<"number of lower case vowels"<<Lcount<<endl;
} // determineNumberUpAndLow
// Calculates average of Upper case and lower case words
int CalculateTwoAverages(string s,int b[N][2],int sum,int sum2)
{ int i,j,avg,avg2,length;
length=s.size();
for (int i = 0;i <= length; i++)
{ avg = sum % length;
avg2= sum2% length;
}
cout << "The first average is " <<avg<< "and the 2nd one is "<<avg2<<endl;
} // CalculateTwoAverages
int main() {
string sen;
int times[N][2];
int sumUp,sumLow;
while (sen != 'END' || (sen != 'end' do
{ determineNumberUpAndLow(sen,times,sumUp,sumLow);
CalculateTwoAverages(sen,times,sumUp,sumLow);
}
cout<<endl;
}// main