Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Latte
- {
- public:
- int milkInOz;
- bool isMilkSteamed;
- int espressoBeansInOz;
- bool isBeansGrounded;
- bool isEspressoBrewed;
- int mugInOz;
- bool readyToCode;
- Latte()
- {
- milkInOz = 0;
- isMilkSteamed = false;
- espressoBeansInOz = 0;
- isBeansGrounded = false;
- isEspressoBrewed = false;
- mugInOz = 12;
- readyToCode = false;
- }
- void groundBeans()
- {
- isBeansGrounded = true;
- }
- void brewEspresso()
- {
- isEspressoBrewed = true;
- mugInOz = mugInOz + (espressoBeansInOz / 2);
- }
- void measureBeans(int inputBeansInOz)
- {
- espressoBeansInOz = inputBeansInOz;
- }
- void measureMilk(int inputMilkInOz)
- {
- milkInOz = inputMilkInOz;
- }
- void steamMilk()
- {
- isMilkSteamed = true;
- }
- void pourSteamedMilk()
- {
- mugInOz = mugInOz + milkInOz;
- }
- void chugLatte()
- {
- readyToCode = true;
- cout << "Nick just chugged " << (mugInOz - 12) << "oz of latte! LETS CODE! " << endl;
- mugInOz = 12;
- }
- void makeLatte(int inputBeansInOz, int inputMilkInOz)
- {
- measureBeans(inputBeansInOz);
- if (!isBeansGrounded)
- {
- groundBeans();
- }
- measureMilk(inputMilkInOz);
- if (!isMilkSteamed)
- {
- steamMilk();
- }
- brewEspresso();
- pourSteamedMilk();
- chugLatte();
- }
- };
- int main()
- {
- Latte latte;
- latte.makeLatte(3, 8);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement