PrintLetters

Download Category:

PrintLetters.zip - (392.91 KB)
[
PrintLetters/Debug/
PrintLetters/Debug/cl.command.1.tlog
PrintLetters/Debug/CL.read.1.tlog
PrintLetters/Debug/CL.write.1.tlog
PrintLetters/Debug/link.4472.read.1.tlog
PrintLetters/Debug/link.4472.write.1.tlog
PrintLetters/Debug/link.4472-cvtres.read.1.tlog
PrintLetters/Debug/link.4472-cvtres.write.1.tlog
PrintLetters/Debug/link.command.1.tlog
PrintLetters/Debug/link.read.1.tlog
PrintLetters/Debug/link.write.1.tlog
PrintLetters/Debug/link-cvtres.read.1.tlog
PrintLetters/Debug/link-cvtres.write.1.tlog
PrintLetters/Debug/mt.command.1.tlog
PrintLetters/Debug/mt.read.1.tlog
PrintLetters/Debug/mt.write.1.tlog
PrintLetters/Debug/PrintLetters.exe
PrintLetters/Debug/PrintLetters.exe.embed.manifest
PrintLetters/Debug/PrintLetters.exe.embed.manifest.res
PrintLetters/Debug/PrintLetters.exe.intermediate.manifest
PrintLetters/Debug/PrintLetters.ilk
PrintLetters/Debug/PrintLetters.lastbuildstate
PrintLetters/Debug/PrintLetters.log
PrintLetters/Debug/PrintLetters.obj
PrintLetters/Debug/PrintLetters.pdb
PrintLetters/Debug/PrintLetters.vcxprojResolveAssemblyReference.cache
PrintLetters/Debug/PrintLetters.write.1.tlog
PrintLetters/Debug/PrintLetters_manifest.rc
PrintLetters/Debug/rc.command.1.tlog
PrintLetters/Debug/rc.read.1.tlog
PrintLetters/Debug/rc.write.1.tlog
PrintLetters/Debug/vc100.idb
PrintLetters/Debug/vc100.pdb
PrintLetters/PrintLetters.cpp
PrintLetters/PrintLetters.sln
PrintLetters/PrintLetters.suo
PrintLetters/PrintLetters.vcxproj
PrintLetters/PrintLetters.vcxproj.filters
PrintLetters/PrintLetters.vcxproj.user
PrintLetters/Question.txt
PrintLetters/Screenshot_1.png
]

Use the program, Arrays of Pointers, on p. 188 of the text as a starting point for this assignment.
(from page 188.):
Arrays of Pointers
With an array of pointers of type char , each element can point to an independent string, and the
lengths of each of the strings can be different. You can declare an array of pointers in the same
way that you declare a normal array. Let ’ s go straight to rewriting the previous example using
a pointer array:
// Ex4_07.cpp
// Initializing pointers with strings
#include
using std::cin;
using std::cout;
using std::endl;
int main()
{
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 < < endl < < "Pick a lucky star!" < > dice;
cout < = 1 & & dice < = 6) // Check input validity cout < < pstart < < pstr[dice - 1]; // Output star name else cout < < "Sorry, you haven't got a lucky star."; // Invalid input cout < < endl; return 0; } Now 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 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 example below: This is the title to your Program 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 • Then, write the code to update 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 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 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 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 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 within Array is = Y

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.