Write a program that prompts the user to login, and displays appropriate messages according to whether...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 <iostream> 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] 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 <iostream> 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]
Expert Answer:
Answer rating: 100% (QA)
include using namespace std int main declare variables string user str... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
A sled plus passenger with total mass 39 kg is pulled 17 m across the snow (k = 0.19) at a constant velocity by a force directed 25 above the horizontal. a. Calculate the work of the applied force W...
-
Write a program that prompts the user to enter the year and first day of the year and displays the calendar table for the year on the console. For example, if the user entered the year 2013, and 2...
-
A researcher wanted to find out if there was difference between older movie goers and younger movie goers with respect to their estimates of a successful actors income. The researcher first...
-
Explain the purpose, uses and advantages of classified statements of cash flows prepared in accordance with IAS 7.
-
Locate the centroid xc of the cross-sectional area for the angle. Then find the moment of inertia Iy' about the centroidal y' axis. Given: a = 2 in b = 6 in c = 6 in d = 2 in Ye tat b-
-
In Problem write the e-system obtained via slack variables for the given linear programming problem. Maximize P = x1 + 2x2 subject to 4x - 3x2 < 12 5x1 + 2x2 s 25 -3x, + 7x, s 32 2x1 + x2 s 9 X1, X2...
-
Suppose that \(u=e^{w}\), where \(w\) is normal with expected value \(\bar{w}\) and variance \(\sigma^{2}\). Then Show that Use the fact that to evaluate \(\bar{u}\). = 1 22 00- ewe-(w-w)/202 dw.
-
Suppose Nikes managers were considering expanding into producing sports beverages. Why might the company decide to do this under the Nike brand name?
-
How do decision makers determine the average age of a reporting entitys accounts receivable?
-
1. Which aspect of the French revolution most disturbed commentators? 2. How would you align each of these writers on a spectrum running from extreme right to extreme left in politics? 3. How would...
-
Comparative balance sheets for 2024 and 2023 and a statement of income for 2024 are given below for Metagrobolize Industries. Additional information from the accounting records of Metagrobolize also...
-
Bedard Corporation reported net income of 300,000 in 2015 and had 200,000 ordinary shares outstanding throughout the year. Also outstanding all year were 45,000 options to purchase ordinary shares at...
-
The following situations relate to Bolivia Company. 1. Bolivia provides a warranty with all products sold. It estimates that it will sell 1,000,000 units of its product for the year ended December...
-
Arantxa Corporation has outstanding 20,000 shares of R\($5\) par value ordinary shares. On August 1, 2015, Arantxa reacquired 200 shares at R\($80\) per share. On November 1, Arantxa reissued the 200...
-
Organic Growth Company is presently testing a number of new agricultural seeds that it has recently harvested. To stimulate interest, it has decided to grant to five of its largest customers the...
-
Use the information presented for Ottawa Corporation in BE10-15, but assume the machinery is sold for \($5\),200 instead of \($10\),500. Prepare journal entries to (a) update depreciation for 2016...
-
Design a countdown timer in Verilog to show the count down from an initial value set by the two push buttons on the prototype FPGA board. For the design, - Use two push buttons to set the time in...
-
Wal-Mart is the second largest retailer in the world. The data file on the disk holds monthly data on Wal-Marts revenue, along with several possibly related economic variables. a) Using computer...
-
Revise Programming Exercise 31.1 to write a server for multiple clients. Write a server for a client. The client sends loan information (annual interest rate, number of years, and loan amount) to the...
-
Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14. Use the % operator to extract...
-
Using the BigInteger class introduced in Section 10.9, you can find the factorial for a large number (e.g., 100!). Implement the factorial method using recursion. Write a program that prompts the...
-
Outline three different depreciation methods and appraise them in the context of the definition and objectives of depreciation.
-
Are depreciation expenses either too subjective or too arbitrary to provide useful information?
-
The following actual and estimated figures are available. Based on these figures, evaluate the following. a. Calculate annual depreciation under the straight-line method. b. Calculate the...
Study smarter with the SolutionInn App