A.Y
B.N
C.NG
第1题
下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是()。 publicclassFindKeyWords{ publicstaticvoidmain(sring[]args){ stingtext= “Anarrayisadatastructurthatstoresacollectionof” +“valuesofthesametype.YOUaccesseachindividualvalue'’ +“throughanintegerindex.Forexample,ifaiSanarray” +“of inergers,thena[i]iSthe ith integer in thearray.”; In tarrayCount=0; Intidex=-1; Sting arrarStr=“array”; IndeX=text.indexof(arrayStr); While(index______0){ ++arrayCount; Index+=arrayStr.length(); IndeX=text.indexof(arrayStr,indeX); } SyStem.out.phntln (“thetextcontains”+arrayCount+“arrays”); } }
A.<
B.=
C.<=
D.>=
第2题
下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是()。 publicclassFindKeyWords{ publicstaticvoidmain(sring[]args){ stingtext= “Anarrayisadatastructurthatstoresacollectionof” +“valuesofthesametype.YOUaccesseachindividualvalue'’ +“throughanintegerindex.Forexample,ifaiSanarray” +“of inergers,thena[i]iSthe ith integer in thearray.”; In tarrayCount=0; Intidex=-1; Sting arrarStr=“array”; IndeX=text.indexof(arrayStr); While(index______0){ ++arrayCount; Index+=arrayStr.length(); IndeX=text.indexof(arrayStr,indeX); } SyStem.out.phntln (“thetextcontains”+arrayCount+“arrays”); } }
A.<
B.=
C.<=
D.>=
第3题
(30 )下列程序的功能是统计字符串中 “ array ” 的个数,在程序的空白处应填入的正确选项是
public class FindKey Word s{
public static void main(sring[] args){
sting text=
“ An array is a data structur that stores a collection of ”
+ “ values of the same type . You access each individual value ”
+ “ through an integer index . For example,if a is an array ”
+ “ of inergers, then a[i] is the ith integer in the array. ” ;
Int arrayCount =0;
Int idex = -1;
Sting arrarStr = ” array ” ;
Index = text.indexof(arrayStr);
While(index______ 0) {
++arrayCount;
Index += arrayStr.length();
Index = text.indexof(arrayStr,index);
}
System.out.println
(“ the text contains ” + arrayCount + “ arrays ” );
}
}
A) <
B) =
C) <=
D) >=
第4题
下面程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是 public class FindKeyWords{ public static void main(String[]args) { String text="An array is a data structur that stores a collection of" +"values of the same type. You access each indMdual value" +"through an integer index. For example,if a is an array" +"of inergers,then a[i]is the ith integer in the array."; int arrayCount=0; int index=-1; String arrayStr="array"; index=text.indexOf(arrayStr); while(index>=0) { ++arrayCount; index+=arrayStr.length(); index=text.indexOf(arrayStr,index); } System.out.println("the text contains"+arrayCount+"arrays"); } }
A.<
B. =
C.<=
D.>=
第5题
A.<
B.=
C.<=
D.>=
第6题
A.<
B.=
C.<=
D.>=
第7题
在下列程序的空白处,应填入的正确选项是()。
A.WriterObject
B.Writer
C.BufferedWriter
D.writerObject
第8题
在下列程序的空白处,应填入的正确选项是()。
A.start()
B.close()
C.read()
D.write()
第9题
第10题
下面这个Sub过程的功能是统计字符串中“a”的个数,请在空白处填上合适的代码完成程序。
Private Sub numCount()
Dim hum As Integer
s$ = "software And hardware"
num = Len(s$)
For i = 1 To hum
b$=______
If b$ = "a" Then x = x+1
Next i
Print "x="; x
End Sub
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!