| | |
please help me!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
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: 467 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






