i can't use my installer here in computer...i'm just a beginner and all i know is basic now..im not totally saying do my assignment..even a instruction is a big help for me...thanks...
.im working 7:00 am - 7:00 pm and have my class at 7:00 pm - 10:00 pm...
Well it's hard for us to help we do not know what you know since you have provided no code for us to help with. The assignment is basically this:
1) Read in a sentence - std::getline will do nicely.
2) Replace the spaces with newlines
1. declare a char array. char str[ N ]; // where N is the length of the array and since you are using turbo c and std::string doesn't exist
2. use cin.getline(); to be able to "get the whole line" instead of cin >> w/c can only read a word.
1 2
cin.getline( str, N );
// where str is the array we declared earlier and N is the length of it
3. use a for loop to check each element of str if it is equal to a space ' ', if so, then replace it w/ a newline'\n'
it should look something like :
1 2 3 4
for( int i = 0; i < strlen( str ); i++ ) { // strlen() returns the length of the string passed to it.
// if str[ i ] is equal to space ' '
// then replace str[ i ] with '\n'
}
4. then normally print it : cout << str;
remember to include the necessary headers, namely
1 2 3
// since you're using turbo C
<iostream.h> // for cout, istream::getline()
<string.h> // for strlen()