Computer Science, asked by Satwikmishra, 1 year ago

WRITE A PROGRAMME OF C++ WHICH CONTAINS A CLASS NAME STUDENT​

Answers

Answered by Raghuroxx
1

Answer:

class student

{

private:

char name[30];

int rollNo;

int total;

float perc;

public:

void getDetails(void);

void putDetails(void);

};

void student::getDetails(void)

{

cout << "Enter name: " ;

cin >> name;

cout << "Enter roll number: ";

cin >> rollNo;

cout << "Enter total marks outof 500: ";

cin >> total;

perc=(float)total/500*100;

}

void student::putDetails(void)

{

cout << "Student details";

cout << "Name:"<< name << ",Roll Number:" << rollNo << ",Total:" << total << ",Percentage:" << perc;

}

int main()

{

student std;

std.getDetails();

std.putDetails();

return 0;

}

Explanation:

Hope it's help you❕❗️❕

thank you❕❗️❕

Answered by VARNITKAUR
1

BELATED

HAPPY FRIENDSHIP DAY MY BESTIE

HAVE A WONDERFUL DAY

Similar questions