Класс PopcornPopper - Nero-ro/Facade GitHub Wiki
- on()
- off()
- pop()
- toString()
#ifndef POPCORNPOPPER_H
#define POPCORNPOPPER_H
#include
#include
using namespace std;
class PopcornPopper
{
private:
QString description;
public:
PopcornPopper(QString description); void on(); void off(); void pop(); QString toString();
};
#endif // POPCORNPOPPER_H
#include "popcornpopper.h"
PopcornPopper::PopcornPopper(QString description)
{
this->description = description;
}
void PopcornPopper::on() {
cout << description.toStdString() << " on" << endl;
}
void PopcornPopper::off() {
cout << description.toStdString() << " off" << endl;
}
void PopcornPopper::pop() {
cout << description.toStdString() << " popping popcorn!" << endl;
}
QString PopcornPopper::toString() {
return description;
}