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

📄 intro2.cpp

📁 hello everybody. good lucky to you
💻 CPP
字号:
// INTRO2.CPP--Example from Chapter 3, "An Introduction to C++" 
// INTRO2.CPP calculates a sales slip.

#include <iostream.h>
float tax (float) ;

int main()
{
	float purchase, tax_amt, total;
	cout << "\nAmount of purchase: ";
	cin >> purchase;

	tax_amt = tax(purchase);
	total = purchase + tax_amt;
	cout.precision(2);
	cout << "\nPurchase is: " << purchase;
	cout << "\nTax: " << tax_amt;
	cout << "\nTotal: " << total;

	return 0;
}

float tax (float amount)
    {
        float rate = 0.065;
	return(amount * rate);
    }

⌨️ 快捷键说明

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