please help me!

Reply

Join Date: Nov 2007
Posts: 4
Reputation: zizimetalique is an unknown quantity at this point 
Solved Threads: 0
zizimetalique zizimetalique is offline Offline
Newbie Poster

please help me!

 
0
  #1
Dec 12th, 2007
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’;

}
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 16,452
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1600
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: please help me!

 
0
  #2
Dec 12th, 2007
>>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.
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 499 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC