Answer to Question #250634 in C++ for Nor

Question #250634

Previous lesson displays static information. In this lesson we are going to use the dynamic display of information. #include <iostream> using namespace std; int main(){ //we declare data types here. string name; //fist we need to display the Instruction for the user."Enter your name: cout<<"Enter your name: //we call the "name" variable to get the user input. we use "cin" to get the user input cin>>name; //we call again our variable name to display what the user input. cout<<"Your name is: "<<name; //try it and try to complete the personal information. add the following variables //age, gender, address, email, mobile }


1
Expert's answer
2021-10-13T06:25:03-0400
#include <iostream> 
#include <string> 


using namespace std; 


int main(){ 
	//we declare data types here. 
	//add the following variables 
	//age, gender, address, email, mobile 
	string name; 
	int age;
	string gender;
	string address; 
	string email;
	string mobile;
	//fist we need to display the Instruction for the user."Enter your name: 
	cout<<"Enter your name: ";
	//we call the "name" variable to get the user input. we use "cin" to get the user input 
	cin>>name;
	cout<<"Enter your age: ";
	cin>>age;
	cout<<"Enter your gender: ";
	cin>>gender;
	cout<<"Enter your address: ";
	cin>>address;
	cout<<"Enter your email: ";
	cin>>email;
	cout<<"Enter your mobile: ";
	cin>>mobile;
	//we call again our variable name to display what the user input. 
	cout<<"Your name is: "<<name<<"\n";
	cout<<"Your age is: "<<age<<"\n";
	cout<<"Your gender is: "<<gender<<"\n";
	cout<<"Your address is: "<<address<<"\n";
	cout<<"Your email is: "<<email<<"\n";
	cout<<"Your mobile is: "<<mobile<<"\n";
	cin>>email;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS