Question: Create a Package class. A Package has the following variables: string name string address string city string state string zipcode string phone number double weight
Create a Package class. A Package has the following variables:
string name
string address
string city
string state
string zipcode
string phone number
double weight
The Package class has getters and setters for each variable, an argument constructor that takes in all of the information for a package and overloaded operators and
Packagestring name, string address, string city, string state, string zip code, string phone, double weight;
friend bool operator const Package& p const Package& p;
The operator returns true if the name, address, city, state, and zip code match and false otherwise. Please note that the weight is ignored in this operator. This is so that we can search for Packages sent to the same person at the same address.
friend bool operator const Package& p const Package& p;
The operator returns true if name in Package p is less than name in Package p
friend ostream& operator ostream& out, const Package& p;
The output operator displays all of the package information with weight in lbs
Driver File
Create a driver file where you store packages into a set or multiset you get to decide which is the best choice for this When making your choice, consider whether there can be two packages with the same name and address.
How to define a set or multiset of Packagedata type?
set pkgs;
or
multiset pkgs;
The packages have the following information and should be inserted into the set or multiset that you created:
Maria Hernandez
William St
Salinas
California
lbs
Jacobo Zuniga
John St
Salinas
California
lbs
Mariana Alcantar
Main St
Salinas
California
lbs
John Williamson
Third St
Salinas
California
lbs
Maria Hernandez
William St
Salinas
California
lbs
Next, you will ask the user for a Package they want to search for you will need ask for the Package's name, address, city, state, and zip code and set the weight to Search through the set or multiset for a Package that matches the entered Package information. Display all packages that match you might have more than one if there are Package's with the same name and address information. Display the package information this should include the weight of the package Allow the user to repeat the search with new Package information until the user no longer wishes to perform a search.
Sample run:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
