Question: Need help coding a java program that does the following: 1. asks the customer for a log-in and password. 2. with a real log-in of
Need help coding a java program that does the following:
1. asks the customer for a log-in and password.
2. with a real log-in of "Buffet2011" and a real password of "Rank1Bill2008".
3. Allow the customer two (2) attempts to type either. a. Each time the customer enters an invalid log-in or password issue an error message. b. If the customer fails all two (2) log-in attempts, issue another error message and exit the program. c. If the log-in is successful, then the customer can calculate the cost of multiple trades, so there can be a combination of online and broker assisted trades.
1 st Prompt:
What is your name?
2 nd Prompt:
Enter your log-in:
3rd Prompt: If the entries from the 2nd and 3rd prompts match the real log-in and password proceed to the 4th prompt else print the error message(s).
Enter your password:
Error Message When Log-In & Password Incorrect: One of these error messages will be displayed every time the log-in or password is incorrect. The 9 represents the number of attempts left out of two (2). Youll accommodate in the code for the possibility of more than 2 attempts.
Invalid log-in or password! 2 attempts left. Use when >= 2 attempts left
Invalid log-in or password! 1 attempt left. Use when 1 attempt left
Error Message When No More Attempts Left: This error message will be displayed when there are no more attempts left, and the program will terminate. This is NOT a forced exit. The code should automatically sequence to the exit statement at the end of main().
No more attempts left! Contact technical support at 1-800-111-2222.
***OUTPUT WITH 2 UNSUCCESSFUL LOG-IN ATTEMPTS***
YEE-TRADE, INC. - The Wild West of Electronic Trading
Welcome to Yee-Trade's stock purchase calculator.
What is your name? Hawkeye Pierce
Enter your log-in: Biff2008
Enter your password: Buffy2011
Invalid log-in or password! 1 attempt left.
Enter your log-in: LastChance
Enter your password: BetterWork
No more attempts left! Contact technical support at 1-800-111-2222.
Thank you for using Yee-Trade's stock purchase calculator!
***OUTPUT WITH CORRECT LOG-IN: EXCEPT FOR LOG-IN***
YEE-TRADE, INC. - The Wild West of Electronic Trading
Welcome to Yee-Trade's stock purchase calculator.
What is your name? Hawkeye Pierce
Enter your log-in: Buffett2011
Enter your password: Rank1Bill2008
Invalid log-in or password! 1 attempt left.
Enter your log-in: Buffet2011
Enter your password: Rank1Bill2008
Do you want to calculate your stock purchases? Enter 'Y' or 'N' to exit: y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
