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

📄 gdp问题.frm

📁 算法教案
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "GDP问题"
   ClientHeight    =   3705
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4890
   LinkTopic       =   "Form1"
   ScaleHeight     =   3705
   ScaleWidth      =   4890
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   2760
      TabIndex        =   10
      Top             =   2040
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   390
      Left            =   2760
      TabIndex        =   6
      Top             =   840
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Caption         =   "我国每GDP发展速度"
      Height          =   1575
      Left            =   240
      TabIndex        =   2
      Top             =   840
      Width           =   2175
      Begin VB.OptionButton Option3 
         Caption         =   "9%"
         Height          =   180
         Left            =   240
         TabIndex        =   5
         Top             =   1200
         Width           =   1095
      End
      Begin VB.OptionButton Option2 
         Caption         =   "8.5%"
         Height          =   180
         Left            =   240
         TabIndex        =   4
         Top             =   780
         Width           =   1095
      End
      Begin VB.OptionButton Option1 
         Caption         =   "8%"
         Height          =   180
         Left            =   240
         TabIndex        =   3
         Top             =   360
         Width           =   1095
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "计算"
      Height          =   495
      Left            =   2040
      TabIndex        =   0
      Top             =   2880
      Width           =   975
   End
   Begin VB.Label Label6 
      Height          =   375
      Left            =   360
      TabIndex        =   12
      Top             =   2520
      Width           =   2295
   End
   Begin VB.Label Label5 
      Caption         =   "年"
      Height          =   375
      Left            =   3960
      TabIndex        =   11
      Top             =   2040
      Width           =   495
   End
   Begin VB.Label Label4 
      Caption         =   "达到目前美国人均GDP$35750,需要:"
      Height          =   375
      Left            =   2760
      TabIndex        =   9
      Top             =   1440
      Width           =   1935
   End
   Begin VB.Label Label3 
      Caption         =   "年"
      Height          =   255
      Left            =   4080
      TabIndex        =   8
      Top             =   960
      Width           =   375
   End
   Begin VB.Label Label2 
      Caption         =   "达到人均$20000需要:"
      Height          =   375
      Left            =   2760
      TabIndex        =   7
      Top             =   360
      Width           =   2055
   End
   Begin VB.Label Label1 
      Caption         =   "目前我国人均GDP水平$4580"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   360
      Width           =   2295
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Dim rate As Single
Private Sub Command1_Click()
 Dim gdp As Single
 Dim year As Integer
 year = 0
 gdp = 4580                  '我国目前GDP水平
 If rate = 0 Then
    Label6.Caption = "请选择每年GDP发展速度"
 Else
    Do While gdp <= 20000    'GDP达到$20000
       year = year + 1       '累计年份
       gdp = gdp * (1 + rate)
    Loop
    Text1.Text = Str(year)
    Do While gdp <= 35750    'GDP达到目前美国水平
       year = year + 1       '累计年份
       gdp = gdp * (1 + rate)
    Loop
    Text2.Text = Str(year)
End If
    
 
End Sub

Private Sub Form_Load()
  Label6.Caption = ""
  Text1.Text = ""
  Text2.Text = ""
End Sub


Private Sub Option1_Click()
  rate = 0.08
  Text1.Text = ""
  Text2.Text = ""
  Label6.Caption = ""
End Sub

Private Sub Option2_Click()
  rate = 0.085
  Text1.Text = ""
  Text2.Text = ""
  Label6.Caption = ""
End Sub

Private Sub Option3_Click()
  rate = 0.09
  Text1.Text = ""
  Text2.Text = ""
  Label6.Caption = ""
End Sub

⌨️ 快捷键说明

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