Respuesta :
START
pass = INPUT "Please enter the password:"
IF pass = "NotAtHome" THEN
OUTPUT "Welcome"
ELSE
OUTPUT "Wrong password"
END
pass = INPUT "Please enter the password:"
IF pass = "NotAtHome" THEN
OUTPUT "Welcome"
ELSE
OUTPUT "Wrong password"
END
Following are the pseudocode, program to an input password value.
Program Explanation:
- Defining the header file.
- Defining the main method.
- Inside the method, a string variable "Password" is declared that inputs the string value.
- In the next step, inside the If block, it checks a string value equal to "NotAtHome" if it's true it will print the message "welcome".
Pseudocode:
BEGIN
STRING Password
OUTPUT("Enter password: ")
INPUT Password
IF Password= "NotAtHome" THEN
OUTPUT ("welcome")
END
Program:
#include <iostream>//header file
using namespace std;
int main()//main method
{
string Password;//defining a string variable
cout<<"Enter password:";//print message
cin>>Password;//input string value
if(Password== "NotAtHome")//defining if block that checks Password value equal to NotAtHome
{
cout<<"welcome";//print message
}
return 0;
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/19572184
