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

  Calculate resistance value

Develop a PROLOG program that prompts the user for the colors of Band 1, Band 2, Band 3, and Band 4 and then displays the resistance in Kilo-ohms.

  Write a program that reads a line of text

Write a program that reads a line of text, changes each uppercase letter to the lowercase, and places in a queue and onto a stack. The program should then verify whether the line of text is a palindrome.

  Create a separate test directory

Use jUnit to write thorough unit tests for the Phone and Employee classes. Do not put test code in the src directory, instead, create a separate test directory.

  Create a windows form application project.

Add an Enter Friend button which will process the entries made in the textboxes; writing each entry to a file and an Exit button which will exit the application

  Show how to write a regular expression for a keyword

Show how to write a regular expression for a keyword in a caseinsensitive language. Illustrate the idea by writing the expression for \select" in SQL.

  Ruby on rials to design app

Use ruby on rials to design app. It has to have a database and at least 4 pages Style is free you can design it as the way that you like

  Create set-list of enumerated constants called week

Create set/list of enumerated constants called week which contains days of week. Have variable called today that is of kind week. Allot a value to today.

  Write stored function that takes in zipcode as parameters

Write a stored function called zip_exist that takes in a zipcode.zip%Type parameter and returns a Boolean. The function will return TRUE if the zipcode passed into it exists.

  Median-of-medians algorithm partitions input into groups

Median-of-medians algorithm to solve selection problem. Complete following exercises. Median-of-medians algorithm partitions input into groups of 5 elements, but it also works if we partition input into groups of 7.

  Generate code for the given three address statements

Generate code for the following three-address statements again assuming stack allocation and assuming a and b are arrays whose elements are 4-byte values.

  Determining whether it is possible to reuse code

You are a project manager and have been told that you need to reuse some given code in your new development effort. How would you go about determining whether it is possible to reuse code for this effort?

  Program to calculate overtime pay for salary based employee

To calculate overtime pay for a salary based employee, first find hourly rate by dividing gross pay by 40, and then calculate overtime pay.

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