定义结构类型并声明变量如下: Structure Person Dim Name As String Dim Age As Integer End Structure Dim p As Person 若要给结构变量p赋值,下列选项正确的是___________。A.p=("王小明",18)B.Name = "王小明" : Age =18C.p.Name = "王小明" : p.Age =18D.Person.Name = "王小明" : Person.Age =18

定义结构类型并声明变量如下: Structure Person Dim Name As String Dim Age As Integer End Structure Dim p As Person 若要给结构变量p赋值,下列选项正确的是___________。

A.p=("王小明",18)

B.Name = "王小明" : Age =18

C.p.Name = "王小明" : p.Age =18

D.Person.Name = "王小明" : Person.Age =18


参考答案和解析
Stru是结构变量

相关考题:

下面可以正确定义2个整形变量和1个字符串变量的语句的是( )。A.Dim n,m AS Interger,s AS StringB.Dim a%,b$,c AS StringC.Dim a AS Integer,b,c AS StringD.Dim x%,y AS Integer,z AS String

下面可以正确定义两个整型变量和—个字符串变量的语句是______。A.Dim n,m As Integer,s As StringB.Dim a%,b$,c As StringC.Dim a As Integer,b,c As StringD.Dim x%,y As Integer,z As String

( 11 )下面可以正确定义 2 个整形变量和 1 个字符串变量的语句的是( )A ) Dim n,m AS Interger,s AS StringB ) Dim a%,b$,c AS StringC ) Dim a AS Integer,b,c AS StringD ) Dim x%,y AS Integer,z AS String

假设有如下的记录类型: Type Student number As String name AS String age As Integer End Type 则正确引用该记录类型变量的代码是______。A.Student. name="" s. name="张红"B.Dim s As Student s. Dame="张红"C.Dim s As Type Student s. name="张红"D.Dim s As Type s. name="张红"

有如下的记录类型Type studentid As Stringname As Stringage As IntegerEnd Type则正确引用该记录类型变量的代码是( )A.student.name=”Sias”B.Dim s As students.mane=”Sias”C.Dim s As type students.name=”Sias”D.Dim s As types.name=”Sias”

设有如下的用户定义类型: Type Student number As String name As string age As Integer End Type 则以下正确引用该类型成员的代码是______。A. Student name="李明”B.Dim s As Student s.name="李明"C.Dim s As Type Student s.name="李明"D.Dim s As Type s.name="李明"

下列对变量的定义中,不能定义a为变体变量的是A.Dim a As DoubleB.Dim a As VariantC.Dim aD.a=24

如下数组声明语句,正确的是( )。A. Dim a[3, 4] As IntegerB. Dim a(34) As IntegerC. Dim a(n,n) As IntegerD. Dim a(3,4) As Integer

设有以下函数过程 Private Function Fun(a( )As Integer,b As String)As Integer … End Function 若已有变量声明: Dim x(5)As Integer,n As Integer,ch As String 则下面正确的过程调用语句是( )。A.x(O)=Fun(x."ch")B.n=Fun(n.ch)C.CallFun X,"ch"D.n=Fun(x(5),ch)

设有如下的记录类型: TypeStudent number As String name AS String age As Integer End Type 则正确引用该记录类型变量的代码是( )。A.Student.name="张红"B.Dim s As Student s.name="张红"C.Dim s As Type Student s.name="张红"D.Dim s As Type s.name="张红"

设有如下的记录类型: Type Student Number As String Name As String Age As Integer End Sub 则能正确引用该记录类型变量的代码是( )。A.Student.name=""B.Dim s As Students.name=“张红”C.Dims As Tye Students.name=“张红”D.DimsAsTypes.name=“张红”

有如下语句: Type Student Name As String Age As Integer Sex As String End Type Dim Stu As Student With Stu .Name="张红" .Age=22 .Sex="女" End With 执行Print Stu.Age语句后的结果是A.张红B.22C.“女”D.Age

假定在工程文件中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 要求当执行事件过程Commandl_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是:A. Prirate Sub Commandl Click() Dim B As Books Open"C:\Person.txt"For Output As #1B.Name=InputBox("输入姓名")B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Pdrate Sub Commandl Cliok() Dim B As Books Open"c:\Person.txt"For Input As #1B.Name=InputBox("输入姓名")B.TeINum=InputBox("输入电话号码") Print #1,B.Name,B.TelNum Close #1 End SubC.Private Sub Commandl Click() Dim B As Books Open"c:\Person.txt"For Output As #1 Name=InputBox("输入姓名") TelNunl=InputBox("输入电话号码") Write #1,B Close #1 End SubD.Private Sub Commandl Click() Dim B As Books Open"c:\Person.txt"For Input As #1 Name=InputBox("输入姓名") Temum=InputBox("输入电话号码") Write #1,B.Name,B.TelNuin Close #1 End Sub

有如下用户定义类型及操作语句: Tyoe Student SNo As String Sname As String SAge As Integer End Type Dim Stu As Student With Stu SNo=”200609001” SName=”陈果果“ A ge=19 End With 执行MsgBox Stu,Age 后,消息框输出结果是 【13】

窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。设有如下的类型声明: Type Person name As String*8 major As String*20 End Type 当单击“Command1”按钮时,能够正确地把数据写入文件的程序段是______。A.Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open"C:\data. dat" For Random As #1 Put #1, 1, p Close #1 End SubB.Private Sub Command1_Click() Dim p As Person p. name=Text1.Text p. major=Text2. Text Open"C:\data. dat" For Random As #1 Get #1, 1, p Close #1 End SubC.Private Sub Command1_Click() Dis p As Person p. name=Text1. Text p. major=Text2. Text open "C:\data. dat" For Random As #1 Len=Len(p) Put #1, 1, p Close #1 End SubD.Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open "C:\data. dat" For Random As #1=Len(p) Get #1, 1, p Close #1 End Sub

由如下程序: Type Student Num As Integer Name As String * 13 End Type Dim stu(30)As Student 该程序段定义了两个程序成分,它们分别是 ______。A.记录类型和记录数组B.记录类型和记录变量C.显示类型和记录数组D.记录变量和记录数组

设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时, 在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Print #1, B.Name, B.TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1, B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, Name, TelNum Close #1 End Sub

有如下程序: Private Type stu X As String Y As Integer End Type Private Sub Command1 Click( ) Dim a As stu X="ABCD" Y=12345 Print a End Sub 程序运行时出现错误,错误的原因是( )。A.Type定义语句没有放在标准模块中B.变量声明语句有错C.赋值语句不对D.输出语句Print不对

以下将变量NewVar定义为Integer型正确的是______。A.Integer NewVarB.Dim NewVar Of IntegerC.Dim NewVar As IntegerD.Dim Integer NewVar

Person p = new Person(“张三”,23);这条语句会调用下列哪个构造方法给属性进行初始化() A.public Person(){}B.public Person(String name,int age) { this.name = name; this.age = age; }C.public Person(int age,String name) { this.age = age; this.name = name; }D.public Person(String name) { this.name = name; }

(23)设有以下函数过程Private Function Fun(a() As Integer, b As String) As Integer...End Function若已有变量声明:Dim x(5)As Integer, n As Integer, ch As String则下面正确的过程调用语句是A)x(o)=Fun(x, "ch")B)n=Fun(n, chC)Call Fun x, "ch"D)n=Fun(x(5), ch)

下列对变量的定义中,不能定义A为变体变量的是().A、DIM A AS DOUBLEB、DIM A AS VARIANTC、DIM;AD、A=24

public class Person {  private String name, comment;  private int age;  public Person(String n, int a, String c) {  name = n; age = a; comment = c;  }  public boolean equals(Object o) {  if(! (o instanceof Person)) return false;  Person p = (Person)o;  return age == p.age  name.equals(p.name);  }  }  What is the appropriate definition of the hashCode method in class Person?() A、 return super.hashCode();B、 return name.hashCode() + age * 7;C、 return name.hashCode() + comment.hashCode() /2;D、 return name.hashCode() + comment.hashCode() / 2 - age * 3;

在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。A、Dim  x As IntegerB、Dim  x As Integer,y As SingleC、Var  x,y:IntegerD、Dim  x As Integer,y As Integer

在VB语言中,下列定义变量语句格式正确的是()。A、Dim As String xuehaoB、Dim xuehao As StringC、Dim String As xuehaoD、Const xuehao As String

要声明一个长度为256个字符的定长字符串变量str,下列语句正确的是()A、dim str as stringB、dim str as string(256)C、dim str as string[256]D、dim str as string*256

定义变量的语句Dim abc As String*3是正确的。

如下数组声明语句,正确的是()。A、Dim a[3,4] as IntegerB、Dim a(3,4)as IntegerC、Dim a(n,n)as IntegerD、Dim a[3][4]as Integer