ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 Jun 2017 My Price 9.00

Appendix CIT/218 Version 31Associate Program

Week 4 IT/218

  • Use the program, Arrays of Pointers, on p. 188 of the text as a starting point for this assignment

 

  • Refer to Appendix C for full directions on the changes to the program you must make to complete this assignment

 

This is the program that is on p. 188

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 < iostream >

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!"

 < < "Enter a number between 1 and 6: ";

 cin > > dice;

 

 cout < < endl;

 if(dice > = 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;

}

 

Appendix CIT/218 Version 31Associate Program MaterialAppendix CReferencethe following instructions to assist you when completing your Programming UsingArrays 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 theletter. See the following example: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: 4The number you selected: 4The letter related to this number: Dï‚·Write the code to update every other element within the array with a lowercasex. The outputshould appear like the following:PRINTING CONTENTS OF ARRAY and adding x to every other elementA 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. Theoutput should appear as follows:PRINTING CONTENTS OF ARRAY USING THE MOD Option=====================================================Even Numbered Element = 0 Contents of Element within Array is = AEven Numbered Element = 2 Contents of Element within Array is = CEven Numbered Element = 4 Contents of Element within Array is = EEven Numbered Element = 6 Contents of Element within Array is = GEven Numbered Element = 8 Contents of Element within Array is = IEven Numbered Element = 10 Contents of Element within Array is = KEven Numbered Element = 12 Contents of Element within Array is = MEven Numbered Element = 14 Contents of Element within Array is = OEven Numbered Element = 16 Contents of Element within Array is = QEven Numbered Element = 18 Contents of Element within Array is = SEven Numbered Element = 20 Contents of Element within Array is = UEven Numbered Element = 22 Contents of Element within Array is = WEven Numbered Element = 24 Contents of Element within Array is = Y

Attachments:

Answers

(11)
Status NEW Posted 06 Jun 2017 08:06 AM My Price 9.00

-----------

Attachments

file 1496736887-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)