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

Q2

Q2

Uploaded by

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

Q2

Q2

Uploaded by

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

//#include<iostream>

//#include <string>
//using namespace std;
//
//class Player
//{
//public:
// Player(string name, int score, int balls_played, int matches_played);
//
// virtual double calculateAverage() = 0;
// virtual void display() = 0;
//
// string name;
// int score;
// int balls_played;
// int matches_played;
//};
//
//class Batsman : public Player {
//public:
// Batsman( string name, int score, int balls_played, int matches_played,
// string batting_style, int total_score, int no_of_times_bowled);
//
// double calculateAverage() override;
// void display() override;
//
// string batting_style;
// int total_score;
// int no_of_times_bowled;
//};
//
//class Bowler : public Player {
//public:
// Bowler( string name, int score, int balls_played, int matches_played,
// string bowling_style, int total_wickets, int total_runs_conceded);
//
// double calculateAverage() override;
// void display() override;
//
// string bowling_style;
// int total_wickets;
// int total_runs_conceded;
//};
//
//#include <iostream>
//
//Player::Player(string name, int score, int balls_played, int matches_played)
// : name(name), score(score), balls_played(balls_played),
matches_played(matches_played) {}
//
//Batsman::Batsman( string name, int score, int balls_played, int matches_played,
// string batting_style, int total_score, int no_of_times_bowled)
// : Player(name, score, balls_played, matches_played),
// batting_style(batting_style),
// total_score(total_score),
// no_of_times_bowled(no_of_times_bowled) {}
//
//double Batsman::calculateAverage() {
// return static_cast<double>(total_score) / no_of_times_bowled;
//}
//
//void Batsman::display() {
// cout << "Batsman: " << endl;
// cout << "Name: " << name << endl;
// cout << "Score: " << score << endl;
// cout << "Balls played: " << balls_played << endl;
// cout << "Matches played: " << matches_played << endl;
// cout << "Batting style: " << batting_style << endl;
// cout << "Total score: " << total_score << endl;
// cout << "No. of times bowled: " << no_of_times_bowled << endl;
// cout << "Batting average: " << calculateAverage() << endl;
//}
//
//
//int main()
//{
// Batsman b1("ali", 23, 160, 5, "righthand", 180, 2);
// b1.display();
// cout << b1.calculateAverage();
//
// Bowler b2("Sam", 10, 170, 7, "fAST", 10, 10);
// //b2.display();
// //cout << b2.calculateAverage();
//
//
// system("pause>0");
//
//}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy