
【名词&注释】
子程序(subroutine)、百分制(centesimal system)、返回值、不通过(fail to pass)、结构化的(structured)
[单选题]阅读下面程序,则执行后的结果为#include "stdio.h"fun1(){ int k=20; return k; }fun2(){ int a=15; return a; }fun3(int a,int b){ int k; k=(a-b)*(a+b); printf("%d\n",k);}main(){ un3(fun1(),fun2());}
B. 184
C. 175
D. 编译不通过
查看答案&解析
举一反三:
[单选题]以下选项中循环结构合法的是( )。
A. while (int i7) { i+ + System.out.println("i is" + i): }
B. int j:3; while (j) { System.out.println("j is"+j); }
C. int j=O; for (int k=0; j + k!=10; j + +, k+ +) { System.out.println("j is"+j +,"k is"+ k): }
D. int i=0: do{ {System.out.println("j is"+ j+ +); if (j==3){continue loop;} }while(j10);
[单选题]在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序: Function Func(ByVal x As Integer, y As Integer) y=x*y If y > 0 Then Func = x Else Func = y End If End Function Private Sub Command1_Click( ) Dim a As Integer, b As Integer a=3 b=4 c=Func(a,B)Print "a=";a Print "b=";b Print "c=";c End Sub 程序运行后,单击命令按钮,其输出结果为: ______。
A. a=3 b=12 c=3
B. a=3 b=4 c=3
C. a=3 b=4 c=12
D. a=13 b=12 c=12
[单选题]下列有关数据库的描述,正确的是( )
A. 数据库是一个DBF文件
B. 数据库是一个关系
C. 数据库是一个结构化的(structured)数据集合
D. 数据库是一组文件
[单选题]要建立一个学生成绩的随机文件,如下定义了学生的记录类型,由学号、姓名、三门课 程成绩(百分制)组成,下列程序段正确的是( )。
A. Typepestudl no As Integer name As String score(1 To 3)As Single End Type
B. Typestudl no As Integer no As Integer name As String*10 score()As Single End Type
C. Typestudl no As Integer name As String*10 score(1 To 3)As Single End Type
D. Typestudl no As Integer name As String score(1 To 3)As Single End Type
[单选题]下列程序将Date对象写入文件file42.txt中,选择正确的语句填入下列程序中的横线处。 package ch1; impbrt java. io. *; import java. util. *; public class ex42 { static String fileName = "ch1\\file42.txt"; static Date date = null; public static void main(String[] args) { date = new Date(); try { FileOutputStream fos = new FileOutputStream(file Name); ObjectOutStream os = new ObjectOutputStream(fos); oos.______; oos.close(); fos.close(); System.out.println(date.toString()); } catch(Exception e) { System.out.println(e.getMessage()); } } }
A. writeObject()
B. writeObject(date)
C. write(date)
D. writeByte(date)
本文链接:https://www.zhukaozhuanjia.com/download/zdw4q5.html