Reference no: EM131266149
Assignment
Statement: You will need to implement an application that will hold the customer list for Acme Anvil Supply. This list will be read from a file and stored in a binary tree. The customer file contains fields with the customer number, name, and address (street, city, state and zip). Each field will be in a separate line in the file, thus a given record will be 6 lines in length. The file will be named Customers.txt.
The application will provide the user with a menu to allow them to:
· Load the tree from the file
· Save the tree to the file
· Add a customer to the tree
· Remove a customer from the tree
· Display the list of customers in: (display customer number and name)
o In-order
o Pre-order
o Post-order
· Search the tree for a given: (display customer number, name and address)
o Customer Number
o Customer Name
· Quit the application
Detail Requirements
You will need to have the following classes:
· Customer - This class will hold the information for a customer (in files name Customer.cpp and Customer.h):
o Number
o Name
o Address
o Various setters, getters, operators, including, but not limited to (comparison operators based on the Customer Number):
§ Operator
§ Operator==
§ Operator <>
· Address - This class will hold the information for a customer's address (in files named Address.cpp and Address.h):
o Street (i.e., 33 N. Main)
o City
o State
o Zip
o Various setters, getters, operators, including, but not limited to:
§ Operator <>
· BinaryTree - This is the binary tree class holding the information. Do not use a Template or a Standard Template to implement this. Write a custom tree. Minimally, you will need to implement the following public methods (in files named BinaryTree.cpp and BinaryTree.h):
o addCustomer(Customer *)
o removeCustomer(string customerNumber)
o searchCustomer(string customerNumber) : Customer*
o printCustomers() - print a list of customers (in order by customer number) showing all information about the customer.
o listPreFix() - print a list of customer numbers and names
o listPostFix() - print a list of customer numbers and names
· BinaryTreeNode - the nodes used in the binary tree (In files named BinaryTreeNode.h and optionally, BinaryTreeNode.cpp. You may implement this as a struct or a class)
Sample input file:
00001
Wilee Caytote
123 E. Fifth St.
Phynox
AZ
12345-1234
00002
Dave Walls
123 W. Anywhere St.
Columbus
OH
45402
00012
Robert U. McKey
4986 Boundary St.
Jacksonville
AZ
12345
00123
Ruby B. Edwards
4861 Spring Ave.
Philadelphia
PA
19108.