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);

while (t!=’\n’) {

++i;

cin.get(t);

}

t = ‘\0’;

}

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.