String Variable?

Write a program that will ask for personal details of a student for his bio-data. Ask for his
nickname, age, mobile number, course, year level, and 3 sports activities that he/she wishes to participate into
during the intramurals. Display the summary of information after.

#include <iostream>
#include <string>
using namespace std;

int main(){

string nickname, mobile number, course;
int age, year level;

//Ask for his basic information.
cout << "Nickname: " ;
cin >> nickname >> endl;

cout << "Age: " ;
cin >> age >> endl;

cout << "Mobile #: " ;
cin >> age >> endl;

cout << "Course: " ;
cin >> course >> endl;

cout << "Year Level: " ;
cin >> yearlevel >> endl;

//Ask for his top 3 sports.
cout << "Type 3 sports activities you would wish to join in during the intramurals: " << endl;
cout << "activity 1: " ;
cin >> sports >> endl;

cout << "activity 2: " ;
cin >> sports >> endl;

cout << "activity 3: " ;
cin >> sports >> endl;

return 0;
}



Can you please tell me what is wrong? I am just a beginner here and I don't know how to declare a string variable. Big thanks! :)
Last edited on
string nickname;
then? what shoud i do? can you arrange my code a little bit? Thank you!
Your not making any sense.

You declared nickname, you just asked how and I showed you.

to me it looks like you have it all done but the last part
Display the summary of information after.
Topic archived. No new replies allowed.