Write a program which, in general, reads a space delimited file named data2021.txt into an array...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program which, in general, reads a space delimited file named data2021.txt into an array of structures. Your program must then use a function called print to print out the values inside of all structures where the occupation is "Musician" and the age is greater than 30. The file has 10 rows and 4 columns. Column 1 is the person's first and last name as a single string. Column 2 is an integer indicating the person's age. Column 3 is the person's occupation. Column 4 is a string containing the country the person was born. The structure must then contain 4 elements. The first element in the structure will be a string to hold the person's name. The second will be an integer to hold the person's age. The third will be a string to hold the person's occupation. The fourth will be a string to hold the country the person was born. Thus, each row is to be read into one of the structures in the array of structures. Specific instructions: • In main(), read each row of the file into a structure contained in an array of structures. • From main(), call the print function, passing the entire array to the function. The print function should therefore take the array of structures as an argument (parameter). • In the function, run through each structure in the array and check to see if the occupation is "Musician" and the age is greater than 30. If it is, print out the name, age, occupation and country of birth of the person. If the person does not meet the conditions just outlined, do not print anything for that structure. Write a program which, in general, reads a space delimited file named data2021.txt into an array of structures. Your program must then use a function called print to print out the values inside of all structures where the occupation is "Musician" and the age is greater than 30. The file has 10 rows and 4 columns. Column 1 is the person's first and last name as a single string. Column 2 is an integer indicating the person's age. Column 3 is the person's occupation. Column 4 is a string containing the country the person was born. The structure must then contain 4 elements. The first element in the structure will be a string to hold the person's name. The second will be an integer to hold the person's age. The third will be a string to hold the person's occupation. The fourth will be a string to hold the country the person was born. Thus, each row is to be read into one of the structures in the array of structures. Specific instructions: • In main(), read each row of the file into a structure contained in an array of structures. • From main(), call the print function, passing the entire array to the function. The print function should therefore take the array of structures as an argument (parameter). • In the function, run through each structure in the array and check to see if the occupation is "Musician" and the age is greater than 30. If it is, print out the name, age, occupation and country of birth of the person. If the person does not meet the conditions just outlined, do not print anything for that structure.
Expert Answer:
Answer rating: 100% (QA)
data2021txt LeonelRidley 32 Artist USA InocenciaCorkill 26 Doctor India LeDavalos 31 Musician Austra... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
In this programming assignment you will practice using ArrayLists, Inheritance and Polymorphism. You are to write a game called Magical Creatures War. You will do this by implementing a class called...
-
The main program will call a series of methods to process a set of data. One method will read data into an array. A second method will print the values stored in an array in a neat format. Another...
-
2. For every $1.00 spent on Advertising, the Industry generates $10.00 in Net Sales. You calculate Living Earth's Advertising relationship to Net Sales (show work) and report your comparison of...
-
Bankruptcy, divorce, and tax fraud have the common goal of hiding assets/income from another entity/person. Eventually, the fraudster will want to get access to these assets. How might the assets...
-
In 2021, your client, Clear Corporation, changed from the cash to the accrual method of accounting for its radio station. The company had a positive 481 adjustment of $2,400,000 as a result of the...
-
Determine in which direction the current loop rotates \((a)\) in Figure \(28.21 c\) and \((b)\) in Figure 28. 21d. Data from Figure 28. 21 (a) ! 21 (e) (d) (2)
-
Salt Lake Companys 2015 income statement and selected balance sheet data (for current assets and current liabilities) at December 31, 2014 and 2015, follow. Required Prepare the cash flows from...
-
6. For the given first order reaction 7. AB The half life of the reaction is 0.3010 min. The ration of the initial concentration of reactant to the concentration of reactant at time 2.0 min will be...
-
Hatfield Medical Supplys stock price had been lagging behind its industry averages, so its board of directors brought in a new CEO, Jaiden Lee. Lee had brought in Ashley Novak, a finance MBA who had...
-
Trader Joe's, a popular grocery store chain, has earned tremendous loyalty and a cult-like following. A trip to Trader Joe's may lead the consumer to encounter a tricky parking situation, crowded...
-
How will appropriate and effective use of technology for managing the accounting and financial information flows and presentation be affected.
-
1 1. In the mythical nation of Oz, gasoline used to sell for $3.25 a gallon, and the natives purchased 120,000 gallons a week. Four years ago, the price rose to $4.25 a gallon, and the natives...
-
Most of us have experienced organizational conflict among employees or between employees and the boss. There is no simple answer as to why conflict exists in any organization. However, there are...
-
Jerome operates a clothing store. During the 2021/22 tax year, Jerome used his Mazdaforan estimated 9,000 km of businessrelatedtravel. Jerome had kept a logbook for this vehicle during the 2015/16...
-
One of your clients, Janice Tolk, has entered into an agreement with Dustin Crosby to sell her sole proprietorship for $850,000 on January, 17, 2024. Dustin has been impressed with your explanations...
-
How is Total Productive Maintenance different from Preventive Maintenance and how do you intend to implement Overall Equipment Effectiveness (OEE) / Overall Labor Effectiveness (OLE) /Overall Sales...
-
A 20-cm-square vertical plate is heated to a temperature of 30oC and submerged in glycerin at 10oC. Calculate the heat lost from both sides of the plate.
-
Show that is a linear equation. f(x) = x (3.1.9)
-
How many coupled first-order IVPs are required to solve the problem using RK4 with appropriate initial conditions? dy dt3 = cos(t)
-
Write aMATLAB program that computes the product in Eq. (1.4.1) until it exceeds a particular value s max . S= j=jo (1.4.1)
-
Which process would release energy from goldfission or fusion? From carbon? (a) gold: fission; carbon: fusion (b) gold: fusion; carbon: fission (c) gold: fission; carbon: fission (d) gold: fusion;...
-
If an iron nucleus split in two, its fission fragments would have (a) greater mass per nucleon. (b) less mass per nucleon. (c) the same mass per nucleon. (d) either greater or less mass per nucleon.
-
Is it possible for a hydrogen nucleus to emit an alpha particle? Why? (a) yes, because alpha particles are the simplest form of radiation (b) no, because it would require the nuclear fission of...
Study smarter with the SolutionInn App