akosiraff

Download CharArrayOfPointers CPP

Sep 20th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/chararrayofpointers-cpp/
  3. Use the program, Arrays of Pointers, on p. 188 of the text “Ch. 4, of Ivor Horton’s Beginning Visual C++ 2010″ as a starting point
  4. for this assignment. Refer to Appendix C for full directions on the changes to the program you must make to complete this assignment. // Ex4_07.cpp // Initializing pointers with strings #include using std::cin; using std::cout; using std::endl; int main()
  5. { char* pstr[] = { “Robert Redford”, // Initializing a pointer array “Hopalong Cassidy”, “Lassie”, “Slim Pickens”, “Boris Karloff”, “Oliver Hardy” }; char* pstart(“Your lucky star is “); int dice(0); cout cin > > dice; cout if(dice > = 1 & & dice cout else
  6. cout cout return 0; } Appendix C Reference the following instructions to assist you when completing your Programming Using Arrays and Pointers assignment. • Using a for loop, print the contents of the array. The output should appear like this: PRINTING CONTENTS
  7. OF ARRAY ================================== A B C D E F G H I J K L M N O P Q R S T U V W X Y Z • Change the program logic to prompt you for a position within the array that coincides with the letter. See the following example: This is the title to your Program
  8. related to the alphabet. Select the number that coincides with the alphabet. For example, the number 7 should display the letter G. Enter a number between 1 and 26: 4 The number you selected: 4 The letter related to this number: D • Write the code to update
  9. every other element within the array with a lowercase x. The output should appear like the following: PRINTING CONTENTS OF ARRAY and adding x to every other element A x C x E x G x I x K x M x O x Q x S x U x W x Y x • Write the code that will display only
  10. the even or odd numbered elements within the array. The output should appear as follows: PRINTING CONTENTS OF ARRAY USING THE MOD Option ===================================================== Even Numbered Element = 0 Contents of Element within Array is = A
  11. Even Numbered Element = 2 Contents of Element within Array is = C Even Numbered Element = 4 Contents of Element within Array is = E Even Numbered Element = 6 Contents of Element within Array is = G Even Numbered Element = 8 Contents of Element within Array
  12. is = I Even Numbered Element = 10 Contents of Element within Array is = K Even Numbered Element = 12 Contents of Element within Array is = M Even Numbered Element = 14 Contents of Element within Array is = O Even Numbered Element = 16 Contents of Element within
  13. Array is = Q Even Numbered Element = 18 Contents of Element within Array is = S Even Numbered Element = 20 Contents of Element within Array is = U Even Numbered Element = 22 Contents of Element within Array is = W Even Numbered Element = 24 Contents of Element
  14. within Array is = Y
  15. Download: http://solutionzip.com/downloads/chararrayofpointers-cpp/
Add Comment
Please, Sign In to add comment