⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drainconsole.cpp

📁 C++ Source code from a tutorial
💻 CPP
字号:
// DrainConsole.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

class Drain {
public:
  int HairCount;  // Count of Hairs
  int BugCount;   // Count of Bugs
  int SmallMammalCount;
  Drain(int h, int b, int c) : HairCount(h), BugCount(c),
    SmallMammalCount(c) {}
};

int PlumberPrice(Drain &d, int HoursWorked) {
  int price;
  price = d.HairCount + 3 * d.BugCount + 25;
  return price;
}

int main(int argc, char* argv[])
{

	cout << "Oh my, that drain is seriously clogged!" << endl;
  cout << "This is going to be my price:" << endl;
  cout << "  $1 per hair removed from drain" << endl;
  cout << "  $3 per bug removed from drain" << endl;
  cout << "  $25 per small mammal" << endl;
  cout << "  $50 labor per hour" << endl;

  Drain shower(250, 80, 1);
  cout << "My price is " << PlumberPrice(shower, 5) << endl; 
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -