Created
June 12, 2016 18:42
-
-
Save Soulstorm50/01e49836f9bcb3e2f13b7e46a3418d67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Toy //класс игрушка | |
{ | |
public: // модификатор доступа | |
char* kind; //разновидность | |
char* name; // имя игрушки | |
char* colour; // цвет | |
int year; // год производства | |
double weight; //вес | |
// методы: | |
void Play() //метод Играть | |
{ | |
cout <<"You are plaing with "<<name << " toy now.\n"; | |
} | |
void CheckWeight() //метод проверить вес игрушки | |
{ | |
cout << "The weight of "<<name << " toy is " << weight << " Kg.\n"; | |
} | |
}; | |
void main() | |
{ | |
Toy toy; | |
toy.name = "Elephant"; | |
toy.colour = "wood colour"; | |
toy.kind = "wood"; | |
toy.year = 2015; | |
toy.weight = 0.200; | |
toy.Play(); | |
toy.CheckWeight(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment