Write a function that takes two arrays of strings

Assignment Help Computer Engineering
Reference no: EM132164434

Using C++

Part A. Write a function that takes at least two parameters: a string S, and an array of strings A.

It should search through A to see if S appears anywhere in it. If S is found, the function should return its position (remember that the first position in an array is numbered 0). If S is not found, the function should return -1. so in this context

void main()

{ string names[] = { "Jilly", "Joe", "Jim", "Jenny", "Jemimah" };

int p = find("Jenny", names, ...);

p should be set to 3.

Part B. Write another function that takes at least two parameters: an integer position P, and an array of strings A.

It should change the array A by "removing" the string which is at position P. Of course, you can't just leave a hole in an array.

Removing a string is achieved by moving all following strings up by one position so that the unwanted one is overwritten, and noting that the array is now a little shorter than it used to be. so after doing this

void main() {

string names[] = { "Jilly", "Joe", "Jim", "Jenny", "Jemimah" };

remove(2, names, ...);

names should contain "Jilly", "Joe", "Jenny", and "Jemimah".

Part C. Making use of your answers to parts A and B, write another function that takes two arrays of strings.

It should modify the first array by removing from it any string that appears anywhere in the second array.

Think before writing. There is a very easy way to do this.

Reference no: EM132164434

Questions Cloud

How does central limit theorem apply to this problem : In a random sample of 36 people, find the probability that the average amount spent is more than $61.50. How does central limit theorem apply to this problem?
Describe the frame status quo as it relates to your topic : Topic: "Molecular Biology". Your presentation must: Describe the frame's status quo as it relates to your topic. Argue how your final project intervenes
Write a function that will return a true : Write a function that will return a true, if the ransom note can be constructed from the words in the magazines, otherwise it will return a false.
What is her expected profit for a days worth of pies : If Mamma Temte sells her pies for $4 each, what is her expected profit for a days worth of pies? Assume that any leftover pies are given away.
Write a function that takes two arrays of strings : Write a function that takes at least two parameters: a string S, and an array of strings A.
Interpret the value of the mean : Suppose the number of tickets written per day follow a poisson distibution with a mean of 8.5. Interpret the value of the mean.
Find the temperature which is exceeded by the high : Find the temperature which is exceeded by the high tempature 90% of the days in august.
Define an enumeration type : Write a function, triangleShape, that takes as parameters three numbers, each of which represents the length of a side of the triangle.
What is a q statistic : What is a q statistic? Why should i care about it? How do I interpret it?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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