Create and work with an array of strings

Assignment Help Programming Languages
Reference no: EM132130557

Task: Working with Arrays

Overview

In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, we'll use the values to calculate some basic statistics.

Instructions

Lets get started.

1. Create your own Working With Arrays project, and copy in the code of your user input functions, or your custom terminal user input code file and header.

2. Add the following functions and procedures based on the week's videos:

Create an index of function which will return the index of a given name in the array. This should return -1 if the name is not present.

int index_of(string value, string data[], int size)

Hint: Use similar logic to was found.

contain from the video, but return the index where the name

Create a print summary procedure that accepts the array and its size, then prints out all of the names, the total length of these names, the index of your name (or -1 if your name is not in the array), and the shortest name.
void print_summary(string data[], int size)

Have main create and work with an array of strings

Use a constant for the size (make it 5) Loop to read in the names
Call print summary to output the details

3. Run your program twice to test both with and without your name in the array, then grab a screenshot of the output.

Reference no: EM132130557

Questions Cloud

Evaluate the overall performance of the firm sales force : xplain why it is important to evaluate the overall performance of the firm's sales force and list the advantages and disadvantages of sales
What decisions were or were not made in the case study : What decisions were or were not made in the case study? Do you believe the decisions or best practices were appropriate?
Who are the stakeholders in case : 1.1 Who are the stakeholders in this case and what are their stakes? 1.2 Is it possible for stakeholder relationship to be only one-way? Discuss.
Will it affect the overall credibility of your agency : What effect will such a drastic measure have on the personnel's families? If you keep them, will it affect the overall credibility of your agency?
Create and work with an array of strings : Create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console
What concrete evidence or support is the author using : The questions to consider in your post are: What concrete evidence or support is the author using to sway the audience? Are there fallacies in her logic?
Data on what makes a car american : The article titled "Data on What Makes a Car American" Is Not-So-Fine-Tuned from the Wall Street Journal before answering the questions below.
Read the case history and discuss the management strategy : Read the case history and discuss the Management strategy that resulted in Reader's Digest's bankruptcy.How would you change the strategy that resulted
What obstacles does each character face : What specific claims you can make about the movies. the main character in each movie struggles to succeed in their goal. This would be a good claim to explore.

Reviews

Write a Review

Programming Languages Questions & Answers

  Implement the factorial function in the io monad

Use imperative-style programming to implement the factorial function in the IO monad. In other words, create and initialize variables (references) using newIORef, modify their values using a while loop with ,readIORef and writeIORef, then have th..

  Does the kind of values assigned to a a variable

Does the kind of values assigned to a a variable (numeric or character) influence the way SAS reads data?

  Create an application that has a button that has info

Create an application that has a button that has "Enter your info." When clicked it will present a JDialog that has labels and text boxes.

  Program to display all products and ask user to select

Write a program which displays all products you have and ask user to select, for instance 1 for Optical Mouse. Show the price and ask user for quantity. Compute the amount.

  Write program to list all english-math and science teachers

Suppose that input consists of a file of teachers. You are told to write a program to list all English, math, and science teachers. Each teacher can teach only one subject.

  Explain drawbacks to using ajax technology

What are some of the other drawbacks to using AJAX technology? Why are some of these very significant items to consider before implementing AJAX on a given website?

  Create a spreadsheet to calculate the total costs

Create a spreadsheet to calculate the total costs for each item, total cost, and percent of the total used for each item. Be sure to label columns and rows so it is clear what is in your spreadsheet. Also, type in your formulas and use functions..

  About linux programming language

creates a new process by duplicating the calling process. The new process, referred to as the child, is an exact duplicate of the calling process, referred to as theparent

  Find the maximum and minimum of a list of numbers

Write a prolog program to find the maximum and minimum of a list of numbers.

  Explain how perl deallocates dynamic memory

It's one thing to TALK about how Perl manages dynamic memory. it is another thing completely to SEE how Perl manages dynamic memory.

  What is a recursive function

I have a question related to a recursive function. I have ran it and got it to do what it is supposed to. However, I don't fully understand how it is actually working and how it gets the answer

  Why is lisp dominating the artificial intelligence

What is the difference between functional and imperative programming language?

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