The AnswerCreate C++ Program for Username & Password

  • Context: Comp Sci 
  • Thread starter Thread starter mayeh
  • Start date Start date
  • Tags Tags
    C++ Strings
Click For Summary
SUMMARY

The discussion focuses on creating a C++ program that prompts users for a username and password, with the password masked for security. The program must limit the user to three incorrect attempts before displaying "ERROR" and terminating. Key points include the use of C++ strings for input handling and the necessity of platform-specific implementations, particularly for console applications. The user, identified as "ayen_lee," seeks guidance due to a lack of clarity in their coursework.

PREREQUISITES
  • Understanding of C++ string manipulation
  • Knowledge of console input/output in C++
  • Familiarity with conditional statements and loops in C++
  • Awareness of platform-specific programming considerations
NEXT STEPS
  • Explore C++ string functions, particularly string::compare
  • Learn about handling user input securely in C++
  • Research methods for masking input in console applications
  • Investigate platform-specific differences in C++ console applications
USEFUL FOR

This discussion is beneficial for beginner C++ programmers, students tackling homework assignments related to user authentication, and developers interested in secure input handling techniques.

mayeh
Messages
14
Reaction score
0
c++ strings help!

Homework Statement



Create a C++ program that would ask the user for a username and password. Password field should be masked. If the user exceeded three errors, a string will be seen on the screen which says “ERROR” and exits the program.

username: ayen_lee
password: zpobhabzabc21


Homework Equations



i'm sorry but i don't have any idea about this thing.. it wasn't taught to us clearly.. please help.
 
Physics news on Phys.org
maybe this will help you:

http://www.cplusplus.com/reference/string/string/compare.html

do you have any idea how to proceed?
 
mayeh said:
i'm sorry but i don't have any idea about this thing.. it wasn't taught to us clearly.. please help.
Where are you having problems? Understanding the question? Understanding how the program should behave? Outlining your program? Designing your program? Implementing a specific component of your program?

We can't effectively help you unless we know what you have already done and where you are having problems.


(Incidentally, your implementation will necessarily be platform-specific. For example, it is impossible to write that program to run in a linux console with only standard C routines)
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 14 ·
Replies
14
Views
35K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K