Write a program that will perform sorting and searching across records stored in a file. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that will perform sorting and searching across records stored in a file. The program should first query the user for a filename. The program should open the file and read the first entry. It defines the number of records in the file. The program should read each record and store it into memory. Each record in the file will have sets of three lines. Each set consists of: lastname, firstname, and birthdate. Your program should prompt the user for a command: Searching - The user should be able to supply a search value and your program should print any entries that start with that value. You should search all first names, last names, and birthdates. There may be multiple values returned. Sorting - The user should be able to choose to print the data in its original unsorted form, sorted by first name, or sorted by last name. Quit – Exit the program Code must be well commented. Write a program that will perform sorting and searching across records stored in a file. The program should first query the user for a filename. The program should open the file and read the first entry. It defines the number of records in the file. The program should read each record and store it into memory. Each record in the file will have sets of three lines. Each set consists of: lastname, firstname, and birthdate. Your program should prompt the user for a command: Searching - The user should be able to supply a search value and your program should print any entries that start with that value. You should search all first names, last names, and birthdates. There may be multiple values returned. Sorting - The user should be able to choose to print the data in its original unsorted form, sorted by first name, or sorted by last name. Quit – Exit the program Code must be well commented.
Expert Answer:
Answer rating: 100% (QA)
include include include include using namespace std Class Person definition class Person private Dat... View the full answer
Related Book For
Artificial Intelligence A Modern Approach
ISBN: 978-0137903955
2nd Edition
Authors: Stuart J. Russell and Peter Norvig
Posted Date:
Students also viewed these programming questions
-
Your task is to write a program that will sequentially print the command line arguments to a program, with each argument on a new line. If no arguments have been provided, print this message and exit...
-
Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:...
-
Write a program that will take as input two Web page URLs and find a path of links from one to the other. What is an appropriate search strategy is bidirectional search a good idea? Could a search...
-
About "Hilton Honors" 1) Explain what creates value and identify if there are aspects that do not create value. (Please include the citation and references) 2)What is the strength of the Hilton Honor...
-
The recruitment process should not be initiated with an employee resignation or termination. An effective company should always be looking for strong candidates, both internally and externally. A...
-
A 10-year bond issued by Zamyad Company has a market price of \($725\) and a par value of \($1,000.\) If the bond has an annual interest rate of 7.5 percent but pays interest semiannually, what is...
-
The following transactions occurred during April 2010, for Sandy Salon Products, Inc.: Requirement 1. Journalize the April transactions for Sandy Salon Products, Inc. Omit explanations. Apr 3...
-
The comparative balance sheet of Morston Educational Supply at December 31, 2016, reported the following: Morstons transactions during 2016 included the following: Requirements 1. Prepare the...
-
3. A baseball pitcher pitches a ball, releasing the ball with a velocity of 22 m/s, 10 above the forward horizontal. Ignore the effect of air drag and spin. Strike zone between 35 cm to 145 cm above...
-
Stewart Recording Studio, owned by Ron Stewart, showed the following bank reconciliation at March 31: A list of deposits made and cheques written during April, taken from the Cash Receipts Journal...
-
Answer the following two questions below. The Film link is located below. WATCH LINK https://digitalcampus-swankmp-net.libproxy.sdsu.edu/sdsu301489/play/98a88b1a7eefad09?referrer=lms when...
-
The chapter describes the global marketing presence of McDonalds, IKEA, and Amazon. Select two additional global companies, and identify their market entry strategies. Support your position.
-
Describe the two types of company websites. What challenges do marketers face when using websites to market their products and services?
-
Water is water, right? Not so! Beverly Hills 90H20 claims to be designed by a world-class team of experts, including a water sommelier. The winner of the Worlds Best Water Award, this water is...
-
Walt Disney created the Disney brand from humble beginnings based on his love of drawing and animation. The Walt Disney Company has since expanded successfully into a global entertainment and media...
-
Traditional direct marketing is still used by marketers to reach targeted consumers. Using the major forms of traditional direct marketing, select three forms, and prepare a presentation using...
-
Discuss database management systems with your class. Explore the multiple facets of database management systems. View the Interaction " Database Management Systems ". Make sure you discuss the three...
-
An investor sells a European call on a share for $4. The stock price is $47 and the strike price is $50. Under what circumstances does the investor make a profit? Under what circumstances will the...
-
How much is a micro-mort worth to you? Devise a protocol to determine this. Ask questions based both on paying to avoid risk and being paid to accept risk.
-
This exercise concerns grammars for very simple languages. a. Write a context-free grammar for the language anbn. b. Write a context-free grammar for the palindrome language: the set of all strings...
-
Suppose that a training set contains only a single example, repeated 100 times. In 80 of the 100 cases, the single output value is I; in the other 20, it is 0. What will a back- propagation network...
-
Describe circumstances that might cause a client to understate assets such as cash and financial investments.
-
Select the best answer for each of the following situations and give reasons for your choice. a. You have been assigned to the year-end audit of a financial institution and are planning the timing of...
-
What prevents the person who opens incoming mail from being able to abstract cash collections from customers?
Study smarter with the SolutionInn App