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

📄 3iii.cpp

📁 C/C++程序设计导论(第二版)》程序源文件
💻 CPP
字号:
#include <iostream.h>
// GetValueBetween()  Inputs and returns a value which
//  is between parameters min and max.
//	IN:		min -- the minimum acceptable input
//			max -- the maximum acceptable input
float GetValueBetween (float min, float max)
 {	float temp, accept;
	cout << "Enter a value between " << min << " , " << max;
	cin >> temp;
	accept = 1.0;
	while (accept > 0.0)
	 {	if (temp >= min)
			if (temp <= max) accept = 0.0;
		if (accept > 0.0)
		 {	cout << "** illegal value, enter again: ";
			cin >> temp;
		 }
	  }		
	return (temp);
 }


void CalcTable (float startperiod, float endperiod)
{
}
void main ()
{	float amount, rate, startperiod, endperiod;
	
	amount = GetValueBetween (0.0, 30000.0);
	rate = GetValueBetween (0.0, 1.0);
	startperiod = GetValueBetween (1.0, 71.0);
	endperiod = GetValueBetween (startperiod, 72.0);

	CalcTable (startperiod, endperiod);}

⌨️ 快捷键说明

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