I'm a beginner and I was only able to do the first part of this program. I want to write a program that sorts mail received in a post office and develop this program using the OOP style with C++ language.
i. The user counts the number of letters to be processed and inputs the value into the application
ii. The application creates the exact number of entries according the number of letters already counted.
iii. The user then picks a letter and inputs three (3) details on the letter: Name of recipient, address of recipient and zip/post code (zip code is a 4 digit number). iv. The application must be able to store all the entered details in the memory v. The application must be able to present any or all of these details through MS-DOS output according to the search command definitions below:
1)Search recipient: Enables the user to query a recipient’s details by entering the name.
2)Search records: Enables the user to query the entire record entries as a table.
3)earch postcode entries: Enables the user to query records which are sorted based on postcode and the number of mails for each postcode.
4)Search entry number: Enables the user to search for any letter using the entry number
This is what I've done so far And I don't know how to do the command definitions.
#include<iostream>
#include<
string>>
using namespace std;
Class Postport
{
private:
int letters;
int Zipcode[1000];
string name[1000], address[1000];
public:
void input();
void output();
};
void Postport::input()
{
cout<<"enter number of letters: ";
cin>>letters;
for(int i=0;i<letters;i++)
{
cout<<"enter details of person: "<<i+1"-> \n"
cout<<"name: ";
cin>>name[i];
cout<<"address: ";
cin>>address[i];
cout<<"zip code: ";
cin>>Zipcode[i];
}
}
void Postport::output()
{
cout<<"\n\nentry\tname\taddress\tZipcode\n";
for(int i=0;i<letters;i++)
{
cout<<i+1<<"\t"<<name[i]<<"\t"<<address[i]<<"\t"<<Zipcode[i]<<"\n";
}
}
int main()
{
class Postport may;
may.input();
may.output();
return 0;
}