I was assigned the following project for my VB.Net programming course:
“Write a program using various procedures to perform the operations listed below. Call these procedures using delegates. Make sure to document your program and have the program print descriptive text along with the numbers in b. and c.
a) Print a text string in reverse word order.
b) Print the number of characters in the string.
c) Print number of words in the string."
Now this raises a couple of questions that I have (some of which are opinion-based) relating to how I should complete the assignment.
First off, what do you guys think my teacher means by “reverse word order”? Do they mean print a text string with the word compositions going backwards (i.e. “siht si a ecnetnes”), do they mean print a text string with the whole words going backwards (i.e. “sentence a is this”), or do they mean both at once (i.e. “ecnetnes a si siht”)? This is one of the opinion-based questions, but I just wanted your guys’ thoughts.
Secondly, what is the syntax to produce the number of characters in a string? I already know the code necessary to get the number of words, but part b of this assignment is confusing me slightly. Any help would be greatly appreciated.
For your second question, the syntax to produce the number of characters in a string is:
As I mentioned in my comments, my guess for your first question is that the teacher wants the words reversed, not the characters, so “this is a sentence” would appear in reverse as “sentence a is this”