Write a C++ program to add, sort, and display the details of a user in an array and also to remove the detail in an array.
Southall Hotel is hosting a brand new year's party, for everyone in town. To make proper arrangements they asked people to register themselves on their website if they are attending the party. The website provides the person with three functionalities
- Register themselves for the event.
- Sort the already registered guests if they want to check whether their friends or acquaintances are already registered or not.
- Cancel their registration from the event if they wish to, by deleting their registered entry.
Write a C++ program to add, sort, and display the details of a user in an array and also to remove the detail in an array.
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.
The class User has the following private attributes/member variables
Data type | Variable |
string | name |
long long int | mobileNumber |
string | username |
string | password |
Include appropriate constructors for the above class.
The class UserBO has the following functions:
Member Function | Description |
void adddetails(string name,long long int mobilenumber,string username,string password,int i) | The function to add the details of a user in an array object. |
void sortdetails(int n) | The function to sort and display the user details |
void removeuser(string name, int n) |
The function to remove the user detail present at the |
Declare an array in the BO class to store the user details
In the main method, create an array of user instances/objects and call the above methods.
Refer sample input and output for formatting specifications.
------------------------------
SAMPLE OUTPUT AND INPUT PROVIDED IN ATTACH KINDLY SEE ! AND MATCH OUTPUT AS IT IS
![[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the number of users:
2
Enter name:
sujatha
Enter mobile number:
8909012345
Enter the username:
sujauser
Enter the password:
qwerty
Enter name:
abinaya
Enter mobile number:
8000543250
Enter the username:
abi123
Enter the password:
passabinaya
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
1
User details after Sorting
Name
Mobilenumber
Username
Password
abinaya
8000543250
abi123
passabinaya
sujatha
8909012345
sujauser
qwerty
Do you wish to continue(y/n):
y
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
Enter the name to be deleted:
abinaya
Deleted successfully
Do you wish to continue(y/n):
Sample Input and Output 2:
Enter the number of users:
Enter name:
usha
Enter mobile number:
9078904561
Enter the username:
usha12345
Enter the password:
ushashankar
Enter name:
aanand
Enter mobile number:
9854432216
Enter the username:
aan123aan
Enter the password:
aanandsunrise
Enter name:
tina
Enter mobile number:
9842234456
Enter the username:
tinaforyou
Enter the password:
qwertypass
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
2
Enter the name to be deleted:
tina
Deleted successfully
Do you wish to continue(y/n):
y
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
1
User details after Sorting
Name
Mobilenumber
Username
Password
aanand
9854432216
aan123aan
aanandsunrise
usha
9078904561
usha12345
ushashankar
Do you wish to continue(y/n):
Sample Input and Output 3:
Enter the number of users:
2
Enter name:
siva
Enter mobile number:
9870056700
Enter the username:
siva123
Enter the password:
sivakumar
Enter name:
krishna
Enter mobile number:
8900989011
Enter the username:
krish_na
Enter the password:
krish1234
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
1
User details after Sorting
Name
Mobilenumber
Username
Password
krishna
8900989011
krish_na
krish1234
siva
9870056700
siva123
sivakumar
Do you wish to continue(y/n):
Sample Input and Output 4:
Enter the number of users:
2
Enter name:
kumar
Enter mobile number:
9879090867
Enter the username:
kumar_123_user
Enter the password:
kitkat
Enter name:
joey
Enter mobile number:
7012588700
Enter the username:
user joey
Enter the password:
joey1990
MENU:
1.To sort and display the user details.
2.To remove the user detail.
Enter your choice:
2
Enter the name to be deleted:
joey
Deleted successfully
Do you wish to continue(y/n):](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F207d1139-23ae-479d-8e88-0330a5a9ebcb%2Fa5f55f73-83d2-4e6b-b130-0c7e1da8d42d%2Fs8hacst_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









