Question: Programming Code require 7-2 QQ Account Management (25 point(s)) You are supposed to implement the functions of account Log in' and 'Register for the most
Programming Code require
7-2 QQ Account Management (25 point(s)) You are supposed to implement the functions of account "Log in' and 'Register" for the most popular instant messager 20. The most challenging part is that QQ now has more than a billion users. Input Specification: Each input file contains one test case. For each case, the first line contains an integer N (105) - the total number of queries. Then N lines follow, each contains a query in the format Command Q_No Password where Command is either R (meaning to register a new account, and hence followed by a new account number and a password), or L (meaning to log in with an existing account, and hence followed by the account number and the password); go_No is an integer that is greater than 1000 and no more than 10 digits long; and Password is a string with no less than 6 and no more than 16 characters without any space. Output Specification: For each test case, print the corresponding message for each query in a line. The messages are: If a new account is successfully registered, output "Register Successful"; If the new registering account number already exists, output "ERROR: Account Number Already exists"; If log in successfully, output "Log in Successful"; If the log in account does not exist, output "ERROR: Account Not Exist"; If log in with a wrong password, output "ERROR: Wrong Password". Sample Input: L 1234567890 my00@qq.com R 1234567890 myQQ@qq.com R 1234567890 my00@qq.com L 1234567890 myQ0a99 L 1234567890 my00@qq.com Sample Output: ERROR: Account Not Exist Register Successful ERROR: Account Number Already exists ERROR: Wrong Password Log in Successful 7-2 QQ Account Management (25 point(s)) You are supposed to implement the functions of account "Log in' and 'Register" for the most popular instant messager 20. The most challenging part is that QQ now has more than a billion users. Input Specification: Each input file contains one test case. For each case, the first line contains an integer N (105) - the total number of queries. Then N lines follow, each contains a query in the format Command Q_No Password where Command is either R (meaning to register a new account, and hence followed by a new account number and a password), or L (meaning to log in with an existing account, and hence followed by the account number and the password); go_No is an integer that is greater than 1000 and no more than 10 digits long; and Password is a string with no less than 6 and no more than 16 characters without any space. Output Specification: For each test case, print the corresponding message for each query in a line. The messages are: If a new account is successfully registered, output "Register Successful"; If the new registering account number already exists, output "ERROR: Account Number Already exists"; If log in successfully, output "Log in Successful"; If the log in account does not exist, output "ERROR: Account Not Exist"; If log in with a wrong password, output "ERROR: Wrong Password". Sample Input: L 1234567890 my00@qq.com R 1234567890 myQQ@qq.com R 1234567890 my00@qq.com L 1234567890 myQ0a99 L 1234567890 my00@qq.com Sample Output: ERROR: Account Not Exist Register Successful ERROR: Account Number Already exists ERROR: Wrong Password Log in Successful
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
