Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ HW The file /home/218/database.txt contains 10,000 lines of data. Each line describes one person: Social security number, birth date (YYYYMMDD), first name, last name,

C++ HW

The file /home/218/database.txt contains 10,000 lines of data. Each line describes one person: Social security number, birth date (YYYYMMDD), first name, last name, and zip code. Here are six unexciting lines from the middle of the file: 525373469 19630128 Nancy Frankenstein 88539 525388530 19630228 Darcy Epstein 56906 525397776 19710519 Frances Cadwallader 88625 525535897 19361217 Edwin Frogmorton 07004 525753047 19380123 Alexander Jones 24267 525780779 19420616 Tom Wilson 39264 You are to write a program that reads this file and stores its information in a binary tree. The tree should be ordered on the person's last name; when two people have the same last name, order on their first names. Once your program has constructed the tree, it should enter an interactive loop, taking commands from the user: FIND firstname lastname - display all information about the named person, your program must not crash if no such person exists! ZIP zipcode - display the names of all people living in the given zip code ALL lastname - display all information about all people who have the given last name. HASDOG firstname lastname - Note that the named person owns a dog. This information should be included whenever the person's info is displayed. OLDEST - print the name and zipcode of the oldest person in the database. EXIT - exit, no need to save changes to the database. 

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions