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

  Why does the windows frequently crash

Why use functions at all? Programs could be written without them, so why bother with all the overhead.

  Analyze how the data breach could have been prevented with

write a three to five page paper on your selected case in which youdescribe the data breach incident and the primary

  Design application logic for a company that wants a report

Design the application logic for a company that wants a report containing a breakdown of payroll by department.

  Which symbol is not used in a context diagram

What is the relationship between a context diagram and diagram 0, and which symbol is not used in a context diagram?

  This is a term long project and has 4 phases in phase 4

you have been hired as cio for a small independent auto-parts store - northwest georgia auto parts. the store has

  Write a program to display any specified cubic curve

Write a program to display any specified cubic curve using forward differences to calculate points along the curve path.

  How many details are involved in the full specification

How many details are involved in the full specification of such a small and seemingly simple part of a seemingly simple information system.

  Write an attack script or a program to display the secret

CE4062-CZ4062: COMPUTER SECURITY (SYSTEM SECURITY) ASSIGNMENT. Your first task is to write an attack script or a program to display the secret of any of the following users: alice, charlie, dennis, eve, or fong. The attack program takes one argumen..

  Create and call a void method that stores five million

Create and call a void method (or methods) that stores 5 million random integers in a linked list.

  Make architecture of one computer that will handle interrupt

Make an architecture of one computer that will handle interrupts of different kinds, such as writing, opening, printing, spooling, and so forth.

  Fom an accountants viewpoint separation of duties is

from an accountants perspective separation of duties is self-explanatory. how do small companies that have minimal

  Design an application that instantiates an object

Design an application that instantiates an object of each type and demonstrates all the methods.

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