Can someone give me a nudge with an Assignment?

Below are the intructions I have for an assignment at school. I'm not very big on programming and it doesnt come easy to me. I have parts of the program started however I need assistance. I'm not looking for anyone to write the program for me, I just need to understand what I am doing.

1. Write a C++ program, decode.cpp, that decodes a series of integers entered by the user. It first places the letters A – Z, a – z and a space in a decoder array. Therefore, this array will have 53 elements. The index into this array starts at 0 (the A character).

The user repeatedly enters positive integers that move the index in the array that number of spaces. The character at that index in the decoder array is moved to an answer array. When the end of the decoder array is reached, the index wraps around back to the start of the array. The answer array is printed when the user enters a negative number.

You may assume that the message will be no longer than 20 characters.

Here is a sample run (user input in bold):

Enter an integer to move the decoder (negative to stop): 6
Enter an integer to move the decoder: 34
Enter an integer to move the decoder: 106
Enter an integer to move the decoder: 42
Enter an integer to move the decoder: 23
Enter an integer to move the decoder: 12
Enter an integer to move the decoder: 88
Enter an integer to move the decoder: 194
Enter an integer to move the decoder: 8
Enter an integer to move the decoder: -39

The decoded message is:

Good Luck



The text and spacing in the output should follow the above example exactly. You are required to write functions to initialize the decoder array and print the answer array. You may include others if you like.


This is all I hve so far. I know I am missing a lot and I am going through material on arrays and functions trying to muddle through it.


#include <cstdlib>
#include <iostream>

using namespace std;


void initialize ( char decode[]);
void print ( char answer[], end);


int main(int argc, char *argv[])
{


char decode[53];
char answer[];
int input = 0;
int characterIndex = 0;


cout << "Enter an integer to move the decoder (negative to stop) : ";
cin >> input;

while (input =< 26);

{
characterIndex = (characterIndex = input)



cout << "Enter and integer to move the decoder: "
cin >>

}


system("PAUSE");
return EXIT_SUCCESS;
}
Topic archived. No new replies allowed.