1 / 10

总复习

总复习. 试卷题型. 一、程序阅读与填空(共 26 个空,每空 3 分,共 78 分)共 7 个程序 二、程序编写( 2 小题,每小题 11 分,共 22 分)共有 2 个程序 试题: 1 、课本附录 3 套试卷 2 、课本例题 3 、课后习题 4 、实验报告. 知识点:. 掌握字符串函数,随机函数的使用 掌握选择、循环语句的使用 掌握变量的作用范围 掌握一维数组的使用 掌握冒泡排序和选择排序 掌握过程和函数的建立和调用 掌握列表框各属性和方法 掌握定时器的各种属性和 Timer 事件

salali
Télécharger la présentation

总复习

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 总复习

  2. 试卷题型 • 一、程序阅读与填空(共26个空,每空3分,共78分)共7个程序 • 二、程序编写(2小题,每小题11分,共22分)共有2个程序 • 试题: 1、课本附录3套试卷 • 2、课本例题 • 3、课后习题 • 4、实验报告

  3. 知识点: • 掌握字符串函数,随机函数的使用 • 掌握选择、循环语句的使用 • 掌握变量的作用范围 • 掌握一维数组的使用 掌握冒泡排序和选择排序 • 掌握过程和函数的建立和调用 • 掌握列表框各属性和方法 • 掌握定时器的各种属性和Timer事件 • 掌握自定义坐标系的方法 掌握画点、线、矩形、圆和扇形的方法 • 掌握打开文件的方式及读写

  4. 课后习题: • 习题三:全部 • 习题四:全部 • 习题五:一:1、2、4 二:1、2、4 三:2 • 习题六:一:2、3、6 二:1、3、4 三:2、6 习题七:三:1、2 • 习题九:三:1、2

  5. 文本文件合并。将文本文件"t2.txt"合并到"t1.txt"文件中。文本文件合并。将文本文件"t2.txt"合并到"t1.txt"文件中。 • Private Sub Command1_Click() • Dim s As String • Open "t1.txt" For (1) As #1 • Open "t2.txt" For (2) As #2 • Do While Not EOF(2) • (3) #2, s • Print #1, s • Loop • (4) • End Sub • 【供选择的答案】 • (13) A、InputB、Output C、Append D、Read • (14) A、InputB、Output C、Append D、Read • (15) A、LineB、Input C、Line Input D、Read • (16) A、Close #1B、Close #2 C、Close #1, #2 D、Close #1: #2

  6. 【程序说明】将E:盘根目录下的一个文本文件old.txt复制到新文件new.txt中,并利用文件操作语句将old.dat文件从磁盘上删除。【程序说明】将E:盘根目录下的一个文本文件old.txt复制到新文件new.txt中,并利用文件操作语句将old.dat文件从磁盘上删除。 • Private Sub Command1_Click() • Dim str1 As String • Open "E:\old.txt" For (1) As #1 • Open "E:\new.txt" For Output As (2) • Do While Not EOF(1) • (3) #1, str1 • Print #2, str1 • Loop • Close #1, #2: (4) • End Sub • (1) A、InputB、Output C、Append D、Read • (2) A、#1 B、#2 C、#3 D、#4 • (3) A、LineB、Input C、Line Input D、Read • (4) A、Delete "E:\new.txt“ B、Kill "E:\new.txt" • C、Delete "E:\old.txt" D、Kill "E:\old.txt"

  7. Dim k As Integer • Private Sub Form_Load() • p1.Scale (-100, 100)-(100, -100) • k = 0 : p1.DrawWidth = 5 • Timer1.Interval = 10 : Timer1.Enabled = True • End Sub • Private Sub Timer1_Timer() • p1.Circle (0, 0), 80, vbRed, k * 3.141593 / 180, (k + 1) * 3.141593 / 180 • k = k + 1: If k = 360 Then Timer1.Enabled = False • End Sub • (1) 运行终止时,图片框控件P1中的显示为: • (2) 运行时P1中的圆或圆弧或扇形的绘制方式是:逆时针 • (3) 运行时P1中的圆或圆弧或扇形的半径为: • (4) 将Timer过程中Circle语句内的“k * 3.141593 / 180, (k + 1) * 3.141593 / 180”改为“-k * 3.141593 / 180, - (k + 1) * 3.141593 / 180”,绘图终止时P1中显示

  8. Private Sub Form_Load() • P.Width = P.Height: P.Scale (-10, 10)-(10, -10) • End Sub • Private Sub Command1_Click() • Dim i As Integer, x(8) As Integer, y(8) As Integer, n As Integer • Open "E:\1.txt" For Input As #1 • Do While Not EOF(1) • Input #1, x(n), y(n): n = n + 1 • Loop • Close #1 • For i = 1 To n - 1: P.Line (x(i - 1), y(i - 1))-(x(i), y(i)): Next i • End Sub • 若文件"E:\1.txt"中所有数据为“0,9,-9,2,9,2,-6,-9,6,-9”,单击Command1后图形控件P1中显示的图形为:

  9. 编一求素数的函数过程Prime(x),若x是素数返回True,否则返回False。编一求素数的函数过程Prime(x),若x是素数返回True,否则返回False。 • Function Prime(ByVal x As Integer) As Boolean • Dim i As Integer • If x < 2 Then Exit Function • For i = 2 To Sqr(x) • If x Mod i = 0 Then Exit Function • Next i • Prime = True • End Function

  10. 再见!

More Related