Write the code to update every other element

Assignment Help Programming Languages
Reference no: EM131321817

Assignment

The assignment is as follows: 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 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() { 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 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 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 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 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.

Reference no: EM131321817

Questions Cloud

Why is hacking a big threat to system security : Following the history of hacking, can you say that hacking is getting under control? Why or why not?
What is the difference between the two : In experimental research, there is (are) always independent and Dependant variables. This is one of the most confusing things for students to get about experimental research. It took me a while before I could really pick them out while reading a j..
Create a 20 item likert scale to assess it : Choose a conceptual variable that can be considered to be a trait of interest to you, and create a 20-item Likert scale to assess it. Administer the scale to at least 20 people.
Discussion of the issues of treatment refusal : According to the Christian narrative and the discussion of the issues of treatment refusal, patient autonomy, and organ donation in the topic readings, how might one analyze this case
Write the code to update every other element : 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.
Discuss the major sources of computer crimes : Insider abuse is a major crime category. Discuss ways to solve it.
What training would you suggest for new leaders : Could a new leader "know" how to influence others if a person cannot manage one's behavior? What training would you suggest for new leaders
Devise a plan to compute the cost of computer crime : Study the reporting patterns of computer crimes reporting by industry. Which industry reports best?
Compute the interrater reliability of the coding : Compute the Pearson correlation coefficient between the new measure and the score on the Likert scale. Does the correlation demonstrate construct validity?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that inputs two numbers

Write a program that inputs two (2) numbers and determines which of the two numbers is the smallest. If the numbers are equal, display a message that they are equal

  Write a utility that converts dollars to coins

For the program, you will write a utility that converts dollars to coins. It is a simple program that must have the following: Multiple outputs to the screen

  Explain programming language is machine independent

Explain what does it mean to say that programming language is machine independent? What do you mean by operator precedence? Depending on operator precedence, what values could be related with expression 6 + 2 * 3?

  Identify differences between web design and oops

Identify two differences between web design and object-oriented programming, and explain the limitations of HTML and why XML was developed.

  Displays the contents of the board array

Displays the contents of the board array. Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and column number (or can use another suitable method for move selection).

  Write a perl subroutine that reads in a file containing two

write a perl subroutine that reads in a file containing two strings on each line and creates a hash with the first

  Rewrite the program so input processing

Determine the output displayed when the button is clicked. Determine the output displayed when the button is clicked.

  What causes an infinite loop and how do we break it

Write a loop to print all multiples of three from 0 to 100. What causes an infinite loop? How do we break it? Write a program to compute the impedance, Z, and inductance, L, of an electrical coil given voltage, V.

  Develop the flow diagram

Develop the flow diagram of the information and any control elements needed to ensure proper access for the information.Submit a draft PowerPoint presentation with the following elements

  Determine average cpi for program for clock cycle time

The table above illustrates the execution time of two different compiled programs. Determine the average CPI for each program given that processor has clock cycle time of 1 nS.

  Program to compute net pay of employee

A program to compute net pay of employee. It must permit one to read deposit number, account name, amount deposited, and yesr.check.

  Write program which asks user for names

Write down a program which asks user for names (Prompt user with something like "Enter a name, or q when finished"), assigns new Person (in heap memory) for each of them.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd