Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C Program . Suppose that you want to keep track of the information of people who are interested in branch of sports in

Write a C Program

image text in transcribed

image text in transcribed

. Suppose that you want to keep track of the information of people who are interested in branch of sports in different cities. Your program should include the following; Declare a structure with the following members; o Name Surname (max. 20 characters) ID (Integer) (max. 20 characters) O Sport . City (max. 10 characters) In the main function, ask user to input the number of people. Write a function to input each person's information according to the Sample Run. After the inputting process, ask the user what he/she wants to search (city, sport or first character of the city). Write a function to list the people that live in a specific city. This function receives two parameters; first one for city and the other one for the array of structures. Append the results in a text document named as Results.txt" instead of console. Write a function to list the people that like a branch of sport. This function receives two parameters; first one for branch of sport and the other one for the array of structures. Append the results in a text document named as Results.txt" instead of console. . Write a function to list the people that live in the cities which start with the character that is sent as a parameter to the function. Append the results in a text document named as "Results.txt" instead of console. Sample Run Enter the number of people: 4 Enter name and surname: Ela Toprak Enter ID: 111 Enter Sport: Soccer Enter city: Ankara Enter name and surname: Asli Gezgin Enter ID: 222 Enter Sport: Basketball Enter city: Adana Enter name and surname: Can Kaya Enter ID: 333 Enter sport: Baseball Enter city: Bursa Enter name and surname: Ufuk Yilmaz Enter ID: 444 Enter sport: Snooker Enter city: Bilecik What do you want to search (city, branch of sport, first character of the city)? city Please enter the city to be searched: Ankara Ela Toprak likes Soccer with ID 111 What do you want to search (city, branch of sport, first character of the city)? sport Please enter the branch of sport to be searched: Basketball Asli Gezgin likes Basketball with ID 222 What do you want to search (city, branch of sport, first character of the city)? first char of city Please enter the first character of the city to be searched: A Ela Toprak lives in Ankara with ID 111 Asli Gezgin lives in Adana with ID 222 What do you want to search (city, branch of sport, first character of the city)? Q Bye... Sample File Content (Results.txt) Ela Toprak likes Soccer with ID 111 Asli Gezgin likes Basketball with ID 222 Ela Toprak lives in Ankara with ID 111 Asli Gezgin lives in Adana with ID 222

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions