Write a program that will perform the same operations twice

Assignment Help Data Structure & Algorithms
Reference no: EM131258436

Computer Science

Program- Write a program that will perform the same operations twice, once using an array of structs, and once using a pair of parallel arrays. The data will represent people's names and ages, so the first data structure will be an array of structs, each of which contains a string and an int, while the second will be separate arrays of strings and ints.

For both data structures, use functions to do the following tasks:

Open a user specified file for input. The file will contain a series of people's names and ages.

Get the data from the file and store it into the array space(s)

Search the array(s) for the position of the person with the greatest age, bring back the integer position value.

Output the name and age of the person with the highest age, along with a brief text message.

A main program might take the form of:

openFile
getParallelData
loc = searchParallel
outputParallel
openFile
getStructData
loc = searchStruct
outputStruct

The array sizes should all be 10, but your code should handle files that contain data for less than 10 people and files that contain data for more than 10 people.

The input files will take the form:

John J. Johnson
23
Sally Smith
19
. . .

The output should be something like this (showing the output from both parts):

John J. Johnson is the oldest at 23
John J. Johnson is the oldest at 23

Reference no: EM131258436

Questions Cloud

What is the efficiency of the assembly line : Draw the precedence diagram and assign tasks using five workstations. - What is the efficiency of the assembly line, using your answer to (a)?
Scarcity of resources apply to economic decisions : What are economic resources, and how does scarcity of resources apply to economic decisions? Think of a business firm you recently visited (such as Walmart, Home Depot, Red Lobster, Barnes & Noble, McDonald's, etc.).
What aspects of this action may shock the conscience : Identify the issues your partner has that relate to the exclusionary rule. What aspects of this action may shock the conscience of the court? What ensuing evidence found based on this operation may be discarded as "Fruit of the Poisonous Tree".
Determine the shear flow q in the crosssection : The cross-section is loaded by a torsion moment Mx. The material is linear elastic with shear modulus G. The cross-section is thin-walled with t « a.
Write a program that will perform the same operations twice : Write a program that will perform the same operations twice, once using an array of structs, and once using a pair of parallel arrays. The data will represent people's names and ages, so the first data structure will be an array of structs.
Problem regarding the anuual interest rate : Suppose John had not had to get a $10,000 loan at an anuual interest rate of 10% to buy equipment, but instead he had invested $10,000 of his own money in equipment.
Information on loan payments : How do you measure the value of the financial sector without information on loan payments?
Distinction between diplomatic and legislative immunity : Determine whether or not a conviction is feasible when an alleged perpetrator does not have the required mens rea but has engaged in the actus rea. Provide a rationale to support your position.
Cafe making an economic profit : John's annual accounting profit is $1750, he could earn $1,000 a year as a recycler of aluminum cans, however he prefers to pay $275/year to run the cafe rather than recyle, is the cafe making an economic profit?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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