this is my fifth and last assignment for tommorow.I need help :down:
If someone can write the program will save my ass of getting F for the course.
BTW the deadline is tomorow
chapter 5 is about pointers and strings the last section of the chapter is about
Fundamentals of Characters and Strings there are things like this in the chapter:
Assign input to character array word[ 20 ]
cin >> word
Reads characters until whitespace or EOF
String could exceed array size
cin >> setw( 20 ) >> word;
Reads 19 characters (space reserved for '\0')
Reads a line of text
cin.getline( array, size, delimiter character);
Copies input into specified array until either
One less than the size is reached
The delimiter character is input
char sentence[ 80 ];
cin.getline( sentence, 80, '\n' );
-String handling library <cstring> provides functions to
Tokenize strings (separate them into logical pieces)
I have another assignment too and am working on it + i have c++ final for tommorow and am still alive
Martin if u do this for me u will do a very very big favour
btw i don't have to write the whole problem,i can get some grades if write
Well that doesn't exactly give an answer to how you are meant to map ascii to morse but I have an idea for that. But I'm still just learning c++ myself and I've never been a great coder so although I could do this, it would take me a long time and I just don't have it.
For the mapping, consider an array of morse code that you assign as a constant. Then use the ascii table to compute the correct array index given the characters' integer value. The offset will be a constant, and you need to check for uppercase/lowercase. I know it's a little sketchy but that should give you an idea of how to proceed at least. Once you figure out the first problem, you'll see what to do next I think. Good luck.
I don't get this thing against loops. If you don't use loops, the only thing to do is to have 26 segments of code which read the string and replace a particular letter (or itself capitalised) and replace it with itsMorse code equivalent and a space, before all of which you have to replace all spaces with double spaces (the rest above will add the third one).
I'm afraid I've never been that handy with pointers, but if you want any code debugged, post it here and I'll see what I can do.
Get a clear idea of your algorithm first, and the rest should become clear, at least if you use your help files right!