#include <iostream>
#include <string>
using namespace std;
class Package {
public:
string id;
string status;
Package(string i) : id(i), status("준비중") {}
void update_status(string new_status) {
status = new_status;
if (status == "완료") {
cout << "배송이 끝났습니다" << endl;
}
}
};
int main() {
Package pkg("PKG-001");
cout << pkg.status << endl;
pkg.update_status("배송중")
cout << pkg.status << endl;
pkg.update_status("완료");
cout << pkg.status << endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: