#include <iostream>
using namespace std;
class clsMesinKira{
private:
float a,b;
public:
void setData(float p, float q){
a=p;
b=q;
}
void doCampur(void){
cout<<a+b<<endl;
}
void doTolak(void){
cout<<a-b<<endl; //andaikan nilai pertama tolak nilai kedua
}
void doDarab(void){
cout<<a*b<<endl; //andaikan nilai pertama darab nilai kedua
}
void doBahagi(void){
cout<<a/b<<endl; //andaikan nilai pertama bahagi nilai kedua
}
};
int main() {
clsMesinKira objMesinKira;
objMesinKira.setData(1,2);
objMesinKira.doCampur();
objMesinKira.doTolak();
objMesinKira.doDarab();
objMesinKira.doBahagi();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIGNsc01lc2luS2lyYXsKCXByaXZhdGU6CgkJZmxvYXQgYSxiOwoJcHVibGljOgoJCXZvaWQgc2V0RGF0YShmbG9hdCBwLCBmbG9hdCBxKXsKCQkJYT1wOwoJCQliPXE7CgkJfQoKCQl2b2lkIGRvQ2FtcHVyKHZvaWQpewoJCQljb3V0PDxhK2I8PGVuZGw7CgkJfQoKCQl2b2lkIGRvVG9sYWsodm9pZCl7CgkJCWNvdXQ8PGEtYjw8ZW5kbDsgLy9hbmRhaWthbiBuaWxhaSBwZXJ0YW1hIHRvbGFrIG5pbGFpIGtlZHVhCgkJfQoJCXZvaWQgZG9EYXJhYih2b2lkKXsKCQkJY291dDw8YSpiPDxlbmRsOyAvL2FuZGFpa2FuIG5pbGFpIHBlcnRhbWEgZGFyYWIgbmlsYWkga2VkdWEKCQl9CgkJdm9pZCBkb0JhaGFnaSh2b2lkKXsKCQkJY291dDw8YS9iPDxlbmRsOyAvL2FuZGFpa2FuIG5pbGFpIHBlcnRhbWEgYmFoYWdpIG5pbGFpIGtlZHVhCgkJfQoKCgp9OwoKCgppbnQgbWFpbigpIHsKCWNsc01lc2luS2lyYSBvYmpNZXNpbktpcmE7CglvYmpNZXNpbktpcmEuc2V0RGF0YSgxLDIpOwkKCW9iak1lc2luS2lyYS5kb0NhbXB1cigpOwoJb2JqTWVzaW5LaXJhLmRvVG9sYWsoKTsKCW9iak1lc2luS2lyYS5kb0RhcmFiKCk7CglvYmpNZXNpbktpcmEuZG9CYWhhZ2koKTsKCXJldHVybiAwOwp9