AI智能
改变未来

C#复利存款


窗体界面例子,可以根据个人风格自行设计

在工具箱中名为NumericUpDown
Form.cs

namespace WindowsFormsApplication2{public partial class Form1 : Form{public Form1(){InitializeComponent();}double a,b ,c ;double i, s=0;private void button1_Click(object sender, EventArgs e){a= Convert.ToDouble(numericUpDown1.Value);b= Convert.ToDouble(numericUpDown2.Value/100);c= Convert.ToDouble(numericUpDown3.Value);textBox1.Text = \"\\t年\\t存款余额\\r\\n\";for (i = 1; i <= c; i++ ){s = a + a * b;textBox1.Text +=\'\\t\'+i.ToString()    +\'\\t\'+\"$\"+s+\'\\r\'+\'\\n\';a = s;}}private void button2_Click(object sender, EventArgs e){this.Close();}}}
赞(0) 打赏
未经允许不得转载:爱站程序员基地 » C#复利存款