💻 개발 & CSC++ 프로그래밍

명품 C++ programming 실습 문제 11장 8번

문제 : Circle 클래스는 다음과 같다. 1 2 3 4 5 6 7 8 class Circle { string name; int radius; public: Circle(int radius=1, string name="") { this->radius = radius; this->name = name; } }; Circle 클래스의 객체를 입출력하는 다음 코드와 실행 결과를 참조하여 <<, >> 연산자를 작성하고 Circle 클래스를 수정하는 등 프로그램을 완성하라. 1 2 3 Circle d, w; cin >> d >> w; // 키보드 입력을 받아 객체 d와 w를 완성 cout << d << w << endl; // 객체 d, w 출력 실행 결과 : ...

2020년 4월 2일 · 2 분 · Sobamemil
💻 개발 & CSC++ 프로그래밍

명품 C++ programming 실습 문제 7장 3번

문제 : 1번 ~ 4번 문제까지 사용될 Book 클래스는 다음과 같습니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Book{ string title; int price, pages; public: Book(string title="", int price=0, int pages=0){ this->title = title; this->price = price; this->pages = pages; } void show() { cout << title << " " << price << "원 " << pages << " 페이지" << endl; } string getTitle() { return title; } }; 다음 연산을 통해 공짜 책인지를 판별하도록 ! 연산자를 작성하라. ...

2020년 3월 6일 · 2 분 · Sobamemil
💻 개발 & CSC++ 프로그래밍

명품 C++ programming 실습 문제 7장 2번

문제 : 1번 ~ 4번 문제까지 사용될 Book 클래스는 다음과 같습니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Book{ string title; int price, pages; public: Book(string title="", int price=0, int pages=0){ this->title = title; this->price = price; this->pages = pages; } void show() { cout << title << " " << price << "원 " << pages << " 페이지" << endl; } string getTitle() { return title; } }; Book 객체를 활용하는 사례이다. ...

2020년 3월 6일 · 3 분 · Sobamemil