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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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

  1. Register themselves for the event.
  2. Sort the already registered guests if they want to check whether their friends or acquaintances are already registered or not. 
  3. 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
index entered  from the array

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.
 

Input format:
The first input corresponds to the name of a user.
The second input corresponds to the mobile number.
The third input corresponds to the username.
The fourth input corresponds to the password.

 

Output format:
The output consists of sorting and displaying all the input details.

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):
Transcribed Image Text:[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):
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education