건국대 컴퓨터프로그래밍 2 A+ 명품 C++프로그래밍 CH.3 (실습문제) 과제
- 최초 등록일
- 2022.07.08
- 최종 저작일
- 2022.06
- 15페이지/ 한컴오피스
- 가격 1,500원
소개글
건국대 컴퓨터 프로그래밍 2 과제입니다.
성적: A+
교재: 명품 C++프로그래밍
건국대 컴퓨터 프로그래밍 2 수업 교재 내 예제를 코딩하고 결과를 설명하는 과제입니다.
과제하는 분들 코드를 이해하는 데에 도움이 되었으면 좋겠습니다.
코딩한 것을 사진 파일로 캡쳐해 줄번호에 따라 설명해놓아 이해하기 편하실 겁니다.
코드를 복붙할 수 있게 같이 넣어놓았으니 급하신 분들은 이용하셔도 좋을 것 같습니다.
감사합니다.
목차
없음
본문내용
#include <iostream>
class CoffeeMachine
{
public:
int aoc,aow,su;
CoffeeMachine(int x, int y, int z);
void drinkEspresso();
void show();
void drinkAmericano();
void SugarCoffee();
void fill();
};
CoffeeMachine::CoffeeMachine(int x, int y, int z) :aoc(x),aow(y),su(z){};
void CoffeeMachine::drinkEspresso(){
aoc -= 1;
aow -= 1;
}
void CoffeeMachine::show(){
std::cout <<"커피 머신 상태, 커피:"<<aoc<<" 물:"<<aow<<" 설탕:"<<su <<std::endl;
}
void CoffeeMachine::drinkAmericano(){
aoc -= 1;
aow -= 2;
}
void CoffeeMachine::SugarCoffee(){
aoc -= 1;
aow -= 2;
su -= 1;
}
void CoffeeMachine::fill(){
aoc = 10;
aow = 10;
su = 10;
}
int main()
참고 자료
없음