Suppose that you are coding a cricket game. For this you need to take care of players, ground, crowd,
equipment (bat, ball, stumps etc) and Umpires. This task is too difficult with structural programming,
that why we need to go for Object Oriented Programming. Use the data modeling technique to find:
• Class(es)
• Object(s) in each class
• Attributes of each object
• Constant Object(s) of each class (if any)
• Method(s) of every class
• Static Data in all classes (if any)
I didn't understand what the question was, but I can give some information about the difference between Structured Programming and Object-Oriented Programming, here you can read about it:
https://www.geeksforgeeks.org/difference-between-structured-programming-and-object-oriented-programming/
Here some example of class
class CricketGame {
private:
std::string player;
std::string ground:
// ...
public:
// constructor with no args
CricketGame() {
}
// here might be methods of class ...
}
Comments
Leave a comment