0% found this document useful (0 votes)
22 views

Oop

ex

Uploaded by

Paul
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Oop

ex

Uploaded by

Paul
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

#include <string.h>

using namespace std;

class Student{
int cod;
char *nume;
int nrnote;
int v[20]; //note
float medie;

public:
Student();
Student (int);
Student(int,char *);
Student (const Student&);
// ~Student();
void citire();
void afis();
void setcod(int);
void setnume(char);
void setnote(int);

};

Student::Student()
{
cout<<"fsfsfsf";
nume=new char[25];
};

Student::Student(int cc)
{
cout<<"const cu 1 param";
cod=cc;
nume=new char[25];
};

Student::Student(int cc, char *botez)


{
cout<<"const cu 2 param";
cod=cc;
nume=new char[strlen(botez)+1];
strcpy(nume,botez);

};

void Student::afis()
{

cout<<"note student" <<nrnote;


cout<<"cod student" <<cod;
cout<<" nume student :" <<nume;
for(int i;i<nrnote;i++)
{
cout<<v[i];
}

void Student::citire()
{

cout<<"Codul elevului :"; cin>>cod;


cout<<" Nume elev:"; cin>>nume;
cout<<"\n Note : ";cin>>nrnote;
cout<<endl<<"Notele sunt";

for(int i;i<nrnote;i++)
{
cin>>v[i];
}
}

int main()
{
Student s,s3;
// Student s2(123);
// Student s3(14, "Radu");
s3.citire();
s3.afis();
return 0;
}

You might also like