Before the second case of C # teaching, I first introduced the experiment of a savings calculator. This experiment project was obtained from Microsoft's teaching CD, and some source programs have been provided, the student is required to complete the transaction processing section. When doing this experiment, it is best for students to design this project independently. Here, the code for this project is given as follows. It is characteristic that the control name is in Chinese.
Using System;
Using System. Drawing;
Using System. Collections;
Using System. ComponentModel;
Using System. Windows. Forms;
Using System. Data;
Namespace Saving
{
Enum Compound
{
Calculate monthly interest,
Calculate interest on a quarterly basis
}
/// <Summary>
/// Summary of Form1.
/// </Summary>
Public class Form1: System. Windows. Forms. Form
{
Private System. Windows. Forms. Label label1;
Private System. Windows. Forms. NumericUpDown initial amount;
Private System. Windows. Forms. Label label2;
Private System. Windows. Forms. NumericUpDown interest rate;
Private System. Windows. Forms. Label label3;
Private System. Windows. Forms. Label label4;
Private System. Windows. Forms. ComboBox calculation rules;
Private System. Windows. Forms. Label label5;
Private System. Windows. Forms. Label label6;
Private System. Windows. Forms. Button calculation;
Private System. Windows. Forms. NumericUpDown;
Private System. Windows. Forms. NumericUpDown is stored every month;
Private System. Windows. Forms. NumericUpDown total deposits;
/// <Summary>
/// Required designer variables.
/// </Summary>
Private System. ComponentModel. Container components = null;
Public Form1 ()
{
//
// Required for Windows Form Designer support