Question

In: Computer Science

Write a program that accepts user’s name, password and address and display them back using the...

Write a program that accepts user’s name, password and address and display them back using the format “Hi, I am user’s name. I live at user’s address.”.
Restrictions:
▪ Use only three variables.
▪ Make sure you support spaces.

Solutions

Expert Solution

//Assuming to be done in c++ do comment if any other language needed

// do comment if any problem arises

//code

#include <iostream>

#include <string>

using namespace std;

int main()

{

    //3 variables

    string user_name,password,address;

    //read user name

    cout<<"Enter User's name: ";

    getline(cin,user_name);

    //read user password

    cout<<"Enter User's password: ";

    getline(cin,password);

    //read user address

    cout<<"Enter User's address: ";

    getline(cin,address);

    cout << "Hi, I am "<<user_name<<". I live at "<<address<<".";

}

Output:


Related Solutions

Create a Java application called ValidatePassword to validate a user’s password. Write a program that asks...
Create a Java application called ValidatePassword to validate a user’s password. Write a program that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. Your program should include a method that checks whether a password is valid. From that method, call a different method to validate the uppercase, lowercase, and digit requirements for a valid password. Your program should contain at least four methods in addition...
Using c++, write a program that will display your name as a void function then will...
Using c++, write a program that will display your name as a void function then will perform the following by user-defined functions: a. to compute for the sum of two numbers (n1, n2) using function.
Java - Write a program to calculate a user’s BMI and display his/her weight status. The...
Java - Write a program to calculate a user’s BMI and display his/her weight status. The status is defined as Underweight, Normal, Overweight and obese if BMI is less than 18.5, 25, 30 or otherwise respectively. You need to read weight (in kilogram) and height (in metre) from the user as inputs. The BMI is defined as the ratio of the weight and the square of the height. [10 marks]
Write a C++ program to display toy name
Write a C++ program to display toy name
Using C++ Write a program to ask user to enter a password and validity the password....
Using C++ Write a program to ask user to enter a password and validity the password. The password should be 8 – 20 characters long (8 is included and 20 is included), it should contain at least one uppercase letter and one lower case letter. The password should contain at least one digit, and at least one symbol other than alphabets or numbers. Most importantly, the password may not contain any white space. Functions: You will need at least the...
1. Write a program that keeps asking the user for a password until they correctly name...
1. Write a program that keeps asking the user for a password until they correctly name it. Once they correctly enter the password, the program congratulates the user and tells them how many guesses it took. Be sure to be grammatically correct with the guess/guesses output. Call the program LastNamePassword. Example (user input in italics) What is the password? monkeys Incorrect. Guess again. dishwasher Incorrect. Guess again. aardvark Correct! You got the password, and it took you 3 guesses to...
Program Description Write and test a MASM program to perform the following tasks: Display your name...
Program Description Write and test a MASM program to perform the following tasks: Display your name and program title on the output screen. Display instructions for the user. Prompt the user to enter three numbers (A, B, C) in descending order. Calculate and display the sum and differences: (A+B, A-B, A+C, A-C, B+C, B-C, A+B+C). Display a closing message. Program Requirements The program must be fully documented and laid out according to the CS271 Style Guide. This includes a complete...
-Write in C++ -Use Char library functions Write a function that accepts a string representing password...
-Write in C++ -Use Char library functions Write a function that accepts a string representing password and determines whether the string is a valid password. A valid password as the following properties: 1. At least 8 characters long 2. Has at least one upper case letter 3. Has at least one lower case letter 4. Has at least one digit 5. Has at least on special character
write program in java Create a class named PersonalDetails with the fields name and address. The...
write program in java Create a class named PersonalDetails with the fields name and address. The class should have a parameterized constructor and get method for each field.  Create a class named Student with the fields ID, PersonalDetails object, major and GPA. The class should have a parameterized constructor and get method for each field. Create an application/class named StudentApp that declare Student object. Prompts (GUI input) the user for student details including ID, name, address, major and GPA....
Write a C++ program (using the pthread library) that accepts a phrase of unspecified length on...
Write a C++ program (using the pthread library) that accepts a phrase of unspecified length on the command line. For example: prompt$: ./vowcon Operating Systems Class at CSUN The main() in this program should read the phrase from the terminal. This phrase can be read into a global variable. This phrase or its parts can be directly accessed from the main() and from the threads. The main() has to create two threads running functions (vow and con). The main() can...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT