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
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?
|