[填空题] 下列事件过程的功能是:建立一个名为Data1的随机文件,存放角度值及这些角度的正弦函数值和余弦函数值,角度为1,2,3,…,90。请在空白处填入适当的内容,将程序补充完整。 Private Type Ang K As Integer Sinx As Single Cosx As Single End Type _________________________’定义Ang类型的变量Ksc Private Sub Form_Click() Dim Y As Single Open "C:Datal.txt" For Random As #1 Len = 10 Put #1, 1, Ksc Y = 3.14159 / 180 For i = 1 To 90 Ksc. K=i ______= Sin(i*Y)’给变量Ksc的正弦函数值赋值 Ksc.Cosx = Cos(i*Y) Next i Close #1 End Sub
正确答案:Dim Ksc As Ang Ksc.Sinx
参考解析:声明用户定义类型的变量格式为: Dim 变量名as用户定义类型名 定义了记录类型后,给该类型变量赋值时用“变量名.元素=要赋的值”的格式进行赋值。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)