Ask Question
5 May, 07:41

You need the user of a program to enter a customer's last name. Write a statement that prompts the user to enter this data and assigns the input to a variable.

+2
Answers (1)
  1. 5 May, 10:41
    0
    The statement is cin>>lastname; //In c++.

    lastname=str (input ("Enter the last name/n")) #statement in python.

    Following is the C+ + code:-

    #include

    #include

    using namespace std;

    int main () {

    string lastname; //string variable to hold lastname.

    cout<<"Enter lastname of the user"<
    cin>>lastname; //taking input of the lastname ...

    cout<
    return 0;

    }

    Output:-

    Enter lastname of the user

    khurana

    khurana

    Explanation:

    You can assign the input to the lastname by using cin in c+ + and input in python and creating a scanner class object in java.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “You need the user of a program to enter a customer's last name. Write a statement that prompts the user to enter this data and assigns the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers