Define a new “findPasswordIfUnique”functionthat accepts 4 parameters: oAn array of “User” oobjectpointers oArray’s length oSearch usernameIt will return an integer number: o0 for not foundo1 found but there are other Userobjectswith the same username o2 found andits username isuniquein thatgivenarrayIn addition,it will alsoreturn theassociatedpassword for that user if it is found and unique.Show how this function is being called and return proper information.Do not use malloc. All data members must be declared as “private”•No global variable canbe declared and used•Methods within the classand the requested functionscannot have “cin” or “cout” but it should make use of parameters and return value instead.•“cin” and “cout” should be done in main() or any testing functions•Make sure that you clearly show how the C++ class, its methods and all the functions are being called at least twice and print out its return value and its results properly.
Define a new “findPasswordIfUnique”functionthat accepts 4 parameters:
oAn array of “User”
oobjectpointers
oArray’s length
oSearch usernameIt will return an integer number:
o0 for not foundo1 found but there are other Userobjectswith the same username
o2 found andits username isuniquein thatgivenarrayIn addition,it will alsoreturn theassociatedpassword for that user if it is found and unique.Show how this function is being called and return proper information.Do not use malloc.
All data members must be declared as “private”•No global variable canbe declared and used•Methods within the classand the requested functionscannot have “cin” or “cout” but it should make use of parameters and return value instead.•“cin” and “cout” should be done in main() or any testing functions•Make sure that you clearly show how the C++ class, its methods and all the functions are being called at least twice and print out its return value and its results properly.
In c++ array is a collection of sequential set of elements that store values of same data type
Syntax of Array Declaration
<data type > <array-name> [size];
Example:
int arr[5];
Step by step
Solved in 2 steps