Question: Write a C + + program that checks if the password is correct. The password is a 4 - digit number combination. The program repeats
Write a C program that checks if the password is correct. The password is a digit number
combination. The program repeats to ask the password until the password is correct or you enter to exit.
You will use this program:
#include
using namespace std;
int main
int const password ;
while loop statement
return ;
Input: The password is set to A user input the password to proceed, or to exit.
Sample Output: The program should display the following output. The red text is a user input.
Test case : when you enter the correct password.
Enter the password or to exit:
Password is incorrect.
Enter the password or to exit:
Password is correct.
Test case : when you exit the program.
Enter the password or to exit:
You exit the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
