전체 글 162

[C++]명품 C++ 프로그래밍 실습문제 10장 8번

[C++]명품 C++ 프로그래밍 실습문제 10장 8번 [C++]명품 C++ programming 실습문제 10장 8번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; class Comparable{ public: virtual bool operator >(Comparable& op2)=0; //순수가상함수 virtual bool operator radious =radious;} int getRadious(){return radious;} bool operator >(Comparable &op){ Circle *p = (Circle *)&op; if(this->radious > p->get..

C++ 2023.01.25

[C++]명품 C++ 프로그래밍 실습문제 10장 6번

[C++]명품 C++ 프로그래밍 실습문제 10장 6번 [C++]명품 C++ programming 실습문제 10장 6번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; template T* remove(T src[], int sizeSrc, T minus[], int sizeMinus, int& retsize); int main() { int retsize=0; int src[4] = { 1,2,3,4 }; int minus[4] = { 1,2,3,0 }; int *q = remove(src, 4, minus, 4, retsize); //cout

C++ 2023.01.25

[C++] 명품 C++ 프로그래밍 실습문제 10장 오픈챌린지/openchallenge

[C++]명품 C++ 프로그래밍 실습문제 10장 [C++]명품 C++ programming 실습문제 10장 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include #include #include using namespace std; class Word{ string Eng; string Kor; public: Word(string Eng, string kor){ this-> Eng = Eng; this-> Kor = kor; } string getEng(){return Eng;} string getKor(){return Kor;} }; int main() { string example[4] = { "" }; bool sw = false; srand((unsigne..

C++ 2023.01.25

[C++] 명품 C++ 프로그래밍 실습문제 9장 10번

[C++]명품 C++ 프로그래밍 실습문제 9장 10번 [C++]명품 C++ programming 실습문제 9장 10번 명품 C++ 프로그래밍실습문제/연습문제 /C++ //Circle.cpp #include "Circle.h" void Circle:: draw() { cout getNext(); } void GraphicEditor::deleteItem(int index) { Shape* pre = pStart; Shape* tmp = pStart; if (pStart == NULL) { cout getNext(); delete tmp; } else { pre->add(tmp->getNext()); delete tmp; } } void GraphicEditor::show() { Shape* tmp = pS..

C++ 2023.01.14

[C++] 명품 C++ 프로그래밍 실습문제 9장 9번

[C++]명품 C++ 프로그래밍 실습문제 9장 9번 [C++]명품 C++ programming 실습문제 9장 9번 명품 C++ 프로그래밍실습문제/연습문제 /C++ //Inkjet.cpp #include "Inkjet.h" int Inkjet::getavailabeInk(){return this->availabeInk;} void Inkjet:: print(int pages){ if(isValid(this->availablecount - pages)==true){ // 계산해주기 this-> printedcount = this->printedcount + pages; this-> availablecount = this->availablecount - pages; this-> availabeInk = thi..

C++ 2023.01.14

[C++] 명품 C++ 프로그래밍 실습문제 9장 8번

[C++]명품 C++ 프로그래밍 실습문제 9장 8번 [C++]명품 C++ programming 실습문제 9장 8번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include using namespace std; //순수가상함수를 만들면 된다. class Shape{ protected: string name; int width, heigth; public: Shape(string n = " " ,int W = 0,int h=0){name = n ; width = W; heigth =h;} string getName(){return name; } virtual double getArea(){return 0;} }; class Oval : public Shape{ publ..

C++ 2023.01.14

[C++] 명품 C++ 프로그래밍 실습문제 9장 7번

[C++]명품 C++ 프로그래밍 실습문제 9장 7번 [C++]명품 C++ programming 실습문제 9장 7번 명품 C++ 프로그래밍실습문제/연습문제 /C++ #include #include #include using namespace std; class Shape{ protected: string name; int width, heigth; public: Shape(string n = " " ,int W = 0,int h=0){name = n ; width = W; heigth =h;} virtual string getName(){return name; } virtual double getArea(){return 0;} }; class Oval : public Shape{ public: Oval(s..

C++ 2023.01.14