Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that prompts the user to login, and displays appropriate messages according to whether the details are correct, partially correct, or incorrect:
Write a program that prompts the user to login, and displays appropriate messages according to whether the details are correct, partially correct, or incorrect: user stores the user input for the username, password stores the user input for the password, login has whether the login is successful or not . The program should then display these messages in their respective cases: If user is juan and password is secret, the login is successful and the message displayed should be: Login successful! If either the user is not juan OR the password is not secret, the login is unsuccessful and the message displayed should be: One of the things entered is incorrect Login failed If both the user and password do not match, the login is unsuccessful and the message displayed should be: Login failed Complete the code within the brackets ({}) below. Your Answer: 3 #include 4 using namespace std; int main() { 11 12 13 14 15 16 17 18 19 20 21 22 string user; stringp password; bool login; 28 29 30 31 32 cout < < "Enter a user" < < endl; cin >> user; cout < < "Enter a passsword" < < endl; cin >> password; if(user="juan" { } cout < < "One of the things entered is incorrect" < < endl; login false; else 23 login false; 24 ) 25 if(!login) 26 { 27 sword "secret") cout < < "Login failed" < < endl; line 27: 'constexpr' needed for in-class initialization of static data member 'Cxx Test::List studentClass::Tests_Output Test' of non-integral type [-fpermissive] return 0; Feedback 0.0/ 1.0 Your answer could not be processed because it contains errors: line 27: 'constexpr' needed for in-class initialization of static data member 'Cxx Test::List studentClass::Tests_Output Test' of non-integral type [-fpermissive]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
include using namespace std int main declare variables string user str...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started