#include <iostream>
using namespace std;
class Building {
private:
string adress_m;
int storeyCount_m;
bool quarantine_m;
public:
Building(string adress = "", int count = -1) {
adress_m = adress;
storeyCount_m = count;
}
void addStoreys(int count) {
storeyCount_m += count;
}
void quarantineOn() {
cout << "Quarantine: on";
cout << endl;
quarantine_m = 1;
}
void quarantineOff() {
cout << "Quarantine: off";
cout << endl;
quarantine_m = 0;
}
void quarantineCheck() {
cout << "Quarantine: ";
if(quarantine_m) {
cout << "on";
cout << endl;
} else {
cout << "off";
cout << endl;
}
}
string getAdress() {
return adress_m;
}
int getStorey() {
return storeyCount_m;
}
};
int main() {
Building build("dirt house", 1);
cout << build.getAdress() << " " << build.getStorey() << " storeys" << " " << endl;
build.quarantineCheck();
build.quarantineOn();
build.addStoreys(2);
cout << build.getAdress() << " " << build.getStorey() << " storeys" << " " << endl;
}
#include <iostream>
using namespace std;
class Building {
private:
string adress_m;
int storeyCount_m;
bool quarantine_m;
public:
Building(string adress = "", int count = -1) {
adress_m = adress;
storeyCount_m = count;
}
void addStoreys(int count) {
storeyCount_m += count;
}
void quarantineOn() {
cout << "Quarantine: on";
cout << endl;
quarantine_m = 1;
}
void quarantineOff() {
cout << "Quarantine: off";
cout << endl;
quarantine_m = 0;
}
void quarantineCheck() {
cout << "Quarantine: ";
if(quarantine_m) {
cout << "on";
cout << endl;
} else {
cout << "off";
cout << endl;
}
}
string getAdress() {
return adress_m;
}
int getStorey() {
return storeyCount_m;
}
};
int main() {
Building build("dirt house", 1);
cout << build.getAdress() << " " << build.getStorey() << " storeys" << " " << endl;
build.quarantineCheck();
build.quarantineOn();
build.addStoreys(2);
cout << build.getAdress() << " " << build.getStorey() << " storeys" << " " << endl;
}
Поделитесь своими знаниями, ответьте на вопрос:
Под какими БУКВАМИ записано С ОШИБКОЙ А) For i=1 to 10 do x:=x+1; Б) For i:=1 to N do y:=y/2; В) For i:=10 to 1 do x:=x+y; Г) For i:=1 to 15 do x:=sqr(x); y:=sqr(y); Под какими БУКВАМИ записано БЕЗ ОШИБКИ А) while x:=(x*y)/2 do until (i<10) Б) while i<=10 do begin x:=2+y; i:=i+1; end; В) repeat until i>10 do y:=y+2; i:=i+1; Г) repeat begin i:=i+1; y:=y+2; end; until i>10 Д) repeat y:=x/2; i:=i+1; writeln (y) until i>20
С ошибками : В
Без ошибок : Г