06-25-2018 08:35 PM
Question:
Develop a VI to encode or decode words using a secret code. To encode a word in this code, first separate the word into two substrings – one with the first half of the original word, and one containing the second half. If there is an odd number of letters in the word, then split it so that the first substring has one more letter than the second one.
Create the encoded word by concatenating the first half of the word onto the end of the second half of the word, inserting the second letter of the original word in between these two halves. For example, the word “gravity” would be encoded as “ityrgrav” and the word “master” would be encoded as “teramas.”
Place a string control on the front panel and a Boolean switch allowing the user to select whether the input is to be decoded or encoded. Display the output on a string indicator.
words using a secret code. To encode a word in this code, first separate the word into two substrings – one with the first half of the original word, and one containing the second half. If there is an odd number of letters in the word, then split it so that the first substring has one more letter than the second one.
Create the encoded word by concatenating the first half of the word onto the end of the second half of the word, inserting the second letter of the original word in between these two halves. For example, the word “gravity” would be encoded as “ityrgrav” and the word “master” would be encoded as “teramas.”
Place a string control on the front panel and a Boolean switch allowing the user to select whether the input is to be decoded or encoded. Display the output on a string indicator.
Someone please help 😞 im so lost
06-25-2018 08:45 PM
This sounds like a homework problem. We're not here to do your homework for you; maybe you can show us what you have so far and any specific questions you have.
06-25-2018 08:55 PM
Talk to your classmates. Talk to your instructor. Take the first step (split the word into two sub-strings) and figure out how to do that. Ask yourself:
Bob Schor
P.S. -- from having taught Programming, there is only one way to learn Programming, and that is by Writing Programs.
06-26-2018 05:36 AM
That was a fun little exercise. So where are you stuck? String manipulations can get interesting, but do give the String palette a good look over. There are some really useful functions in there such as String Length, Search/Split String, String Subset, and Concatenate String. Along with those functions, you will probably want a Divide and a Round To +Inf. Use the same functions to decode.
06-26-2018 11:06 AM
Unfortunately, the "code" is now no longer secret. 😄
11-08-2019 06:00 PM
nice try this is your instructor
11-10-2019 12:58 PM
@unljerry wrote:
nice try this is your instructor
To be fair, I think that coming to the forum to ask questions about the homework wasn't a bad idea; it's only when the student asks for answers without explanation, that's where it goes bad. We try to guide the student towards a solution by dropping hints and asking questions that lead them to a conclusion of their own. Think of us as the "tutor collective". 😉
11-11-2019 07:28 AM
Technically, (s)he didn't ask questions. Except "someone please help" perhaps, but that's just one question at most!
Everything else is more a statement that a question.
That's an almost guarantee to not get an answer: making statements, not asking questions.
11-11-2019 07:43 AM
unljerry
you do realize that you are responding to a thread that is over a year old. Those students are long gone.
11-11-2019 07:59 AM
@jamiva wrote:
unljerry
you do realize that you are responding to a thread that is over a year old. Those students are long gone.
Nobody helped, so he might be stuck in that class until someone does.