0% found this document useful (0 votes)
7 views4 pages

oopLABonlineclass

Uploaded by

shehzaibmirza428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

oopLABonlineclass

Uploaded by

shehzaibmirza428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

LAB TASK (ONLINE CLASS)

SHEHZAIB
S2024332016 D1
CODE:
#include <iostream>

using namespace std ;

class Cricket {

private:
string name;
double average ;
string team ;

public :

Cricket( string n = "" , double a = 0.0, string t = "" ){

name = n ;
average = a ;
team = t ;
}

void inputDetails(){

cout<< "Enter Name = ";


cin>>name;
cout<< "\nEnter Average = " ;
cin>> average;
cout<< "\nEnter Team = ";
cin>> team;

void changeDetails(){

cout<< "Enter new player Name = " ;


cin>> name ;
cout<< "\nEnter Average = " ;
cin>> average;
cout<< "\nEnter Team = " ;
cin>> team;

}
void displayDetails(){

cout << "Player name = " << name <<endl;


cout << "Player Average = " << average <<endl;
cout << "Player Team = " << team <<endl;

};

main (){
Cricket C ;

C.inputDetails();
cout << "---------DETAILS--------\n" ;
C.displayDetails();
cout << endl;
cout<< "-----------NEW Player -----------\n";
cout << endl;
C.changeDetails();
cout << "---------DETAILS--------\n" ;
C.displayDetails();

}
OUTPUT:

You might also like