Public synchronized int incContador (int val)

Classified in Computers

Written at on English with a size of 1.17 KB.

#include<iostream>
using namespace std;
class User{
private:
string email;
string password;
public:
User(string e , string p){
email = e;
password = p;
}
string getPassword(){
return password;
}
void setPassword(string p){
password = p;
}
void display(){
cout<< "Email : "<<email<<endl
<<"Password : "<<password<<endl;
}
};

class Student : public User{
private:
int intake;
double cgpa;
public :
Student (string e, string p, int i, double c)
: User (e, p){
intake = i;
cgpa = c;
}
};

int main(){
string e,p;
int i;
double c;
cout <<"Enter the email and password : ";
cin>>e>>p;
Student C(e,p,i,c);
C.Display();
return 0;
}

Entradas relacionadas: