| | |
Help Me(BST)
![]() |
•
•
Join Date: Aug 2006
Posts: 1
Reputation:
Solved Threads: 0
Write a password authentication program using a Binary Search Tree for a fast
username search. Your program must meet the following requirements:
Inputs:
Before doing an authentication, read a file named “authen.pwd” that stores pairs of username and password.
Wait for a command from a user and respond accordingly. For example:
>Add s1limth
passwd: abc123
>Delete s1limth
>Verify s1limth >Verify s1limth
passwd: 321cba passwd: abc123
Invalid Password! Password Confirmed!
>List
s1limth:abc123
s1pornu:456def
>Quit
Outputs:
Update the “authen.pwd” file before exiting the program.
The “authen.pwd” file must conform the following format:
s1limth:abc123
s1pornu:456def
Your program must be named “pwdauth.c” for the source code and
“pwdauth” for the executable.
username search. Your program must meet the following requirements:
Inputs:
Before doing an authentication, read a file named “authen.pwd” that stores pairs of username and password.
Wait for a command from a user and respond accordingly. For example:
>Add s1limth
passwd: abc123
>Delete s1limth
>Verify s1limth >Verify s1limth
passwd: 321cba passwd: abc123
Invalid Password! Password Confirmed!
>List
s1limth:abc123
s1pornu:456def
>Quit
Outputs:
Update the “authen.pwd” file before exiting the program.
The “authen.pwd” file must conform the following format:
s1limth:abc123
s1pornu:456def
Your program must be named “pwdauth.c” for the source code and
“pwdauth” for the executable.
Last edited by Rosicky; Aug 4th, 2006 at 8:22 am.
if you don't know where to start, here's a hint
C++ Syntax (Toggle Plain Text)
int main() { // put your code here }
YOu have to first post ur effort my friend before expecting any kind of help from the forum members.
I don't accept change; I don't deserve to live.
Sacrifice is a painful, pure and beautiful thing.
Dammit, Jones, What the Hell Are Knoll Pointers?!
Sacrifice is a painful, pure and beautiful thing.
Dammit, Jones, What the Hell Are Knoll Pointers?!
Rosicky, try reading this
http://en.wikipedia.org/wiki/Binary_search_tree
http://en.wikipedia.org/wiki/Binary_search_tree
The key to eliminating bugs from your code is learning from your mistakes.
•
•
•
•
Originally Posted by Ancient Dragon
if you don't know where to start, here's a hint
C++ Syntax (Toggle Plain Text)
int main() { // put your code here return 0; }
•
•
•
•
Originally Posted by Ancient Dragon
no I didn't forget it -- it not required in current c or c++ standards. Default is return 0. But some older compilers will complain.
The key to eliminating bugs from your code is learning from your mistakes.
•
•
•
•
Originally Posted by WaltP
Sloppy... Just because it can be done doesn't mean it should...
After all,gets()still exists, doesn't it?
gets() issue is different. It's a dangerous call.
The key to eliminating bugs from your code is learning from your mistakes.
•
•
•
•
Originally Posted by WaltP
Sloppy... Just because it can be done doesn't mean it should...
After all,gets()still exists, doesn't it?
C++ Syntax (Toggle Plain Text)
int main (void) { // your code goes here could mean a lot of things // it can also include the return 0 since its part of the code ;) }
If u go out to tell the beginner programmer everything in a single post without even knowing his skilll set then even this would not suffice
C++ Syntax (Toggle Plain Text)
int main (void) { // write some code to take inuput from user // please dont use scanf () for taking the input since it leaves the // remaining data in the input stream // avoid usign gets () after scanf () since it may read in the data left // from the prev scanf attempt. // dont ever try to clear the input stream using fflush (stdin) since its // behaviour is undefined // and dont forget that main returns an int as a signal to the operting // system about its execution status. // and many more blah blah blah }
I hope now u understand teh meaning of Mr.Ancient Dragon's post.
Take care,
Bye.
Last edited by ~s.o.s~; Aug 5th, 2006 at 12:51 pm.
I don't accept change; I don't deserve to live.
Sacrifice is a painful, pure and beautiful thing.
Dammit, Jones, What the Hell Are Knoll Pointers?!
Sacrifice is a painful, pure and beautiful thing.
Dammit, Jones, What the Hell Are Knoll Pointers?!
![]() |
Similar Threads
- bst complexity (Computer Science)
- BST and SIGSEGV (Pascal and Delphi)
- Binary search tree removal (C++)
- Java DSW algorithm Coding (Java)
- Insertion in a binary search tree (C++)
- Homepage (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: Volunteer C++ programmer needed for
- Next Thread: Neophyte requests assistance...
Views: 1082 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for C++
algorithm array arrays assignment beginner binary browser c++ c/c++ calculator char class classes code command compile compiler console constructor conversion convert count delete desktop display dll dynamic encryption error exception file files fstream function functions game givemetehcodez graph gui homework http iamthwee ifstream input int lazy linker list loop loops math matrix member memory newbie number object objects opengl output parameter path pointer pointers problem program programming project random read recursion recursive reference return simple sort spoonfeeding string strings struct student studio system template templates text time tree variable vc++ vector video visual void win32 window windows winsock wxwidgets xml






