Created
June 12, 2016 19:18
-
-
Save Soulstorm50/ff1fcb32fab2a4e4f7cb545805b5d8a6 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 Flashdrive //класс флешка | |
{ | |
public: // модификатор доступа | |
char* kind; //разновидность | |
char* colour; // цвет | |
double weight; //вес | |
int size; //размер(обьем) | |
// методы: | |
void insert() //метод вставить | |
{ | |
cout << "Вы вставили вашу " << kind << " флешку цвета "<< colour<<", размером в "<<size<<" гигабайт.\n"; | |
} | |
void Throw() //метод выбросить | |
{ | |
cout << "Вы выбросили вашу "<< kind <<" флешку весом в "<<weight<< " грамм.\n"; | |
} | |
}; | |
void main() | |
{ | |
setlocale(0, "RUS"); | |
Flashdrive F; | |
F.kind = "USB 3.0"; | |
F.colour = "синяя"; | |
F.weight = 50; | |
F.size = 16; | |
F.insert(); | |
F.Throw(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment