08 Objects and Classes 1 datatype variable_name = initialization_value; int year = 2010; float score_of_cpp[124]={0}; char *ptr = {“79 golden medal”}; struct point { int x; int y; } centre_point; =0; =0; 2 Consider puter adventure game Among the objects in the game might be: You, the player Your enemies, . dragons Your weapons Obstacles such as locked doors, rivers, etc. The prize . energy or a fair maiden 3 Consider puter adventure game Among the objects in the game might be: You, the player A player will have data values to represent certain attributes, . the state of their health or the weapons they possess. A player must be able to perform functions such as walk, run, attack an enemy, and rescue the fair maiden to win. Your enemies, . dragons Your weapons Obstacles such as locked doors, rivers, etc. The prize . energy or a fair maiden 4 pseudo code representations of the classes class player { // functions: walk( ) run( ) jump( ) attack( ) rescue( ) ... //data: state_of_health type_of_weapon ... } ; class player Team[4] ; class dragon { //functions: walk( ) spit_fire( ) use_claws( ) use_tail( ) die( ) ... //data: size number_of_claws state_of_health ... } ; class dragon e( 10, 4 ) ; 5 pseudo code representations of the classes class dragon { //functions: walk( ) spit_fire( ) use_claws( ) use_tail( ) die( ) ... //data: size number_of_claws state_of_health ... } ; class dragon e( 10, 4 ) ; A class An instance of the class An object is an instance of a class; it has: an identity, . its name a state, . its data members a behaviour, . its member functions. 6 Constructing a class in C++ class ount { public: void open( int acc_no, double initial_balance ) ; void deposit( double amount ) ; void withdraw( double amount ) ; void display_balance() ; private: int account_number ; double balance ; } ; The class member function prototypes The class data m