| | |
please help me!
![]() |
•
•
Join Date: Nov 2007
Posts: 4
Reputation:
Solved Threads: 0
i have to write the count_sentence and the to_lower function assuming the the first parameter is the character array holding the text. The count_sentences function should find the number of sentences in the text by counting periods, question marks, and exclamation points. so far this is the code that i have please help completing this code !
#include <iostream.h>
void get_text(char t[]);
//
// Put
// Prototypes
// Here
//
//
void main()
{
char text[81];
int sentences;
get_text(text);
sentences = count_sentences(text);
to_lower(text);
cout << “There are “<< sentences << “ in this text” <<endl;
cout << text;
}
void get_text(char t[])
{
int i;
cout << “Enter a line of text”;
i=0;
cin.get(t[i]);
while (t[i]!=’\n’) {
++i;
cin.get(t[i]);
}
t[i] = ‘\0’;
}
#include <iostream.h>
void get_text(char t[]);
//
// Put
// Prototypes
// Here
//
//
void main()
{
char text[81];
int sentences;
get_text(text);
sentences = count_sentences(text);
to_lower(text);
cout << “There are “<< sentences << “ in this text” <<endl;
cout << text;
}
void get_text(char t[])
{
int i;
cout << “Enter a line of text”;
i=0;
cin.get(t[i]);
while (t[i]!=’\n’) {
++i;
cin.get(t[i]);
}
t[i] = ‘\0’;
}
>>void main()
Not valid code. use int main() instead.
all you have to do is write two functions. Please show us the code YOU have written to complete that assignment. We will NOT do your homework for you, but will gladly help you write it yourself.
Not valid code. use int main() instead.
all you have to do is write two functions. Please show us the code YOU have written to complete that assignment. We will NOT do your homework for you, but will gladly help you write it yourself.
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
![]() |
Other Threads in the C++ Forum
- Previous Thread: color to grey scale convertion in c graphics
- Next Thread: plz help i have prblm in Borlandc++ graphic.h
Views: 499 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
algorithm api array arrays assignment basic beginner binary c++ c/c++ calculator char class classes code command compile compiler constructor conversion convert count data delete dll dynamic email encryption error file files fstream function functions game givemetehcodez graph gui helpwithhomework homework i/o iamthwee ifstream input int lazy link linker loop looping loops math matrix memory multidimensional newbie news number object objects operator output pointer pointers problem program programming project random read recursion recursive reference return search server simple sort spoonfeeding string strings struct student studio template templates text time tree variable vc++ vector video visual void win32 window windows winsock wordfrequency






