Advertisement
akosiraff

AppendixC_upperlower C/C++ Answer

Jun 20th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/appendixc_upperlower/
  3. Create a single C++ program that performs the following:
  4. • Intialize the pointer array with the sequence of upper/lower case alphabet pairs, Aa Bb Cc …. Xx Yy Zz. (The first element of the array is Aa; the second element of the array is Bb; etc.)
  5. • Using a for loop, print the contents of the array.
  6. The output should appear exactly as follows with heading and single spaces between the elements:
  7. PRINTING CONTENTS OF ARRAY
  8. ==================================
  9. Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz
  10. • Change the program logic to prompt you for a position within the array that coincides with the appropriate letter pair. Your program should be able to duplicate the following session:
  11. Select the number that coincides with the letter pair.
  12. For example, the number 7 should display the pair Gg.
  13. Enter a number between 1 and 26: 4
  14. The number you selected: 4
  15. The pair related to this number: Dd
  16. • Write the code to replace every other element within the original array with a lowercase x. The output should appear exactly as follows with heading and single spaces between the elements:
  17. PRINTING CONTENTS OF ARRAY and adding x to every other element
  18. ========================================================
  19. Aa x Cc x Ee x Gg x Ii x Kk x Mm x Oo x Qq x Ss x Uu x Ww x Yy x
  20. • Write the code that will display only the even index elements within the array. The output should appear exactly as follows with heading:
  21. PRINTING CONTENTS OF ARRAY using the MOD option
  22. =====================================================
  23. Even Index Element = 0 Contents of Element within Array is = Aa
  24. Even Index Element = 2 Contents of Element within Array is = Cc
  25. Even Index Element = 4 Contents of Element within Array is = Ee
  26. Even Index Element = 6 Contents of Element within Array is = Gg
  27. Even Index Element = 8 Contents of Element within Array is = Ii
  28. Even Index Element = 10 Contents of Element within Array is = Kk
  29. Even Index Element = 12 Contents of Element within Array is = Mm
  30. Even Index Element = 14 Contents of Element within Array is = Oo
  31. Even Index Element = 16 Contents of Element within Array is = Qq
  32. Even Index Element = 18 Contents of Element within Array is = Ss
  33. Even Index Element = 20 Contents of Element within Array is = Uu
  34. Even Index Element = 22 Contents of Element within Array is = Ww
  35. Even Index Element = 24 Contents of Element within Array is = Yy
  36.  
  37. Download: https://solutionzip.com/downloads/appendixc_upperlower/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement