-----------ASSEMBLY LANGUAGE PROGRAM ONLY PLEASE 32 BIT REGISTERS AND LOWER-----
ID: 648564 • Letter: #
Question
-----------ASSEMBLY LANGUAGE PROGRAM ONLY PLEASE 32 BIT REGISTERS AND LOWER---------------
Write a "menu-driven" program that reads a paragraph from the keyboard and processes it in the following fashion:
Count and display number of characters
Count and display number of words
Count and display number of sentences
Count and display number of letters that are equal third letter of your last name
Count and display number of capital letters
Count and display number of vowels
Terminate the paragraph with special character (like @, or #, or $, or %,or &).
Display results on screen.
Explanation / Answer
#include<iostream.h>
#include<string.h>
#include<conio.h>
class CountVowels
{
char str[20];
public:
void countlet(char str[])
{
int l=0;
l=strlen(str);
cout<<"Number of letters: "<< l;
}
void countWord(char str[])
{
int w=0;
while(str[]!='')
w++;
cout<<"Number of words="<< w;
}
void countvol(char str[])
{
int s=0,a=0,e=0,i=0,o=0,u=0;
for(s=0;s<=strlen(str);s++)
{
if(str[s]=='A' || str[s]=='a' )
{
a++;
}
if(str[s]=='E' || str[s]=='e')
{
e++;
}
if(str[s]=='I' || str[s]=='i')
{
i++;
}
if(str[s]=='O' || str[s]=='o')
{
o++;
}
if(str[s]=='U' || str[s]=='u')
{
u++;
}
}
cout<<" THE TOTAL NUMBER OF VOWELS IS a: "<<a;
cout<<" THE TOTAL NUMBER OF VOWELS IS e: "<<e;
cout<<" THE TOTAL NUMBER OF VOWELS IS i: "<<i;
cout<<" THE TOTAL NUMBER OF VOWELS IS o: "<<o;
cout<<" THE TOTAL NUMBER OF VOWELS IS u: "<<u;
}
void Case(char str[])
{
int u=0,l=0;
for(i=0;i<strlen(str);i++)
{
while (s[i] != 0)
{
if ((s[i] >= 'a' && s[i] <= 'z'))
{
lowercase++;
l++;
}
else ((s[i] >= 'A' && s[i] <= 'Z'))
{
uppercase++;
u++;
}
}
}
}
};
void main()
{
CountVowels c;
char str[20];
cout<<" ENTER A STRING: ";
cin>>str;
// Call print to print integer
c.countlet(str);
// Call print to print float
c.countvol(str);
//call count word
c.countWord(str);
getch();
// return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.