Write a program that asks the user to enter the name and the hometown of 3...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user to enter the name and the hometown of 3 persons. Name and hometown are stored in a structure Person. The 3 persons are stored in an array. Afterwards, the program asks the user to enter a name and searches the town that person lives in. Use the functions readPerson and search Town. The function search Town has 2 arguments: - the array that needs to be searched - a variable of the type Person that contains the name that needs to be searched. The town member of that variable needs to be filled with the town found by the function search Town. Reading the name of the person you want to search for is done in the main function. Printing the resulting town can also be done in the main function. If the name entered is not present in the array, an appropriate message needs to be printed. (Written in C language) Sample run: Enter name: Smith Enter town or city: Berkeley Enter name: Minogue Enter town or city : London Enter name: O'Neil Enter town or city: Dover Enter the name of the person you want to search for: Smith This person lives in Berkeley Write a program that asks the user to enter the name and the hometown of 3 persons. Name and hometown are stored in a structure Person. The 3 persons are stored in an array. Afterwards, the program asks the user to enter a name and searches the town that person lives in. Use the functions readPerson and search Town. The function search Town has 2 arguments: - the array that needs to be searched - a variable of the type Person that contains the name that needs to be searched. The town member of that variable needs to be filled with the town found by the function search Town. Reading the name of the person you want to search for is done in the main function. Printing the resulting town can also be done in the main function. If the name entered is not present in the array, an appropriate message needs to be printed. (Written in C language) Sample run: Enter name: Smith Enter town or city: Berkeley Enter name: Minogue Enter town or city : London Enter name: O'Neil Enter town or city: Dover Enter the name of the person you want to search for: Smith This person lives in Berkeley
Expert Answer:
Answer rating: 100% (QA)
AnswerHere is the C program include include typedef stru... View the full answer
Related Book For
Posted Date:
Students also viewed these computer engineering questions
-
Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following: The number of characters in the...
-
Write a program that asks the user to enter the name of a file, and then asks the user to enter a character. The program should count and display the number of times that the specified character...
-
Write a program that asks the user to enter his or her first name and then last name, and that then constructs, stores, and displays a third string consisting of the users last name followed by a...
-
Among the 3 dimensioning techniques A, B and C, which one is correct. 50 50 A B 50 C
-
Create a spreadsheet with the following columns: Plaintext character ASCII code (7-bits, binary number) First bit Second bit Third bit Fourth bit Fifth bit Sixth bit Seventh bit Number of bits with...
-
Using real-world examples, discuss the possible limitations of the theory of comparative advantage.
-
In the spring of 1999, Source Associates, Inc. (Source), and Conrad A. Mamajek, Inc. (CAM), entered into a joint venture to act as a middleman for the sale of polymers manufactured by Mitsui...
-
The following data, presented in alphabetical order, are taken from the records of Radar Corporation. Accounts payable................... $ 240,000 Accounts receivable.................. 140,000...
-
sumitomo bank, a large bank in southern california, has just purchased 120 computers to standardized the computer equipment in each of its offices. the purchase was made by the purchasing manager,...
-
A long copper cylinder 0.6 m in diameter and initially at a uniform temperature of 38?C is placed in a water bath at 93?C. Assuming that the heat transfer coefficient between the copper and the water...
-
Q1. Analyze the given piece of poetry on the basis of feminist theory. (5) Yes, she has been fractured, / Broken down / and messed arcund Taken to the heights / And dropped down / But / She picked...
-
During an economic expansion, it is common for the value of property to rise. This means that the value of households wealth rises without them taking any specific action. How would you expect this...
-
What is the Cournot model? How does the output decision in the Cournot model differ from the output decision in a monopoly?
-
Which of the following markets are likely to be perfectly contestable? Explain your answers. a. Coal mining b. Insurance c. Wind Farms d. Landscaping e. Advertising
-
Write a brief essay explaining the accuracy of this statement: The Beatles were once a monopolistically competitive firm that became a monopolist.
-
Explain whether you agree or disagree with the following statement. If all firms in an industry successfully engage in collusion, the resulting profit-maximizing price and output would be the same as...
-
Sam got a job at The Furniture Store. He plans to save $500 every month for three years to buy a car. The savings account earns 2.25% compounded monthly. If he puts the money in his savings account...
-
Havel says the grocer doesnt believe what is on the sign and indeed, he says the grocers customers will barely notice it. But Havel maintains that the sign serves a specific function. How would you...
-
The following data gives the approximate population of the world for selected years from 1850 unti12000. The population P, since 1900 can be modeled by the logistic function: P = 11.55/1 +...
-
Write a user-defined function that plots a circle given the coordinates of the center and a point on the circle. For the function name and arguments, use circle PC (c, p). The input argument c is a...
-
The following are formulas for calculating the training heart rate (THR) for men and women: For men (Karvonen formula): THR = [ (220-AGE)-RHR] x INTEN + RHR For women: THR = [(206-0.88xAGE)-RHR] ...
-
This chapter suggests that estimating project costs is a challenging process that can resemble an art form as much as science. Describe the different methods used to estimate costs on a project. How...
-
Consider the common problems with project cost estimation and recall a project with which you have been involved. Which of these common problems did you encounter most often? Why?
-
Explain the concept of activity-based costing. What are the steps involved in this process?
Study smarter with the SolutionInn App