Compilation fails.
“odd” will always be output.
“even” will always be output.
“odd” will be output for odd values of x, and “even” for even values.
“even” will be output for add values of x, and “odd” for even values.
第1题:
下面程序段的输出结果是( )。 public class Test{ public static void main(String args[]){ int X,y; x=(int)Math.sqrt(5)/2+(int)Math.random*5/2; y=(int)Math.sqrt(3)/2+(int)Math.random*3/2; if(x>v) System.OUt.println("x>y"); elseif(x= =y) System.out.println("x=Y"); else System.out.println("x<y"): } }
A.x>y
B.x=Y
C.x<y
D.编译错误
第2题:
下面程序段的输出结果是 public class Test{ public static void main(Stringargs[]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(ht)Math.random()*3/2; if(x>y) System.out.println(”x>y”); else if(x=y) System.out.println(”x=y”); else System.out.Println(”x<y”); } }
A.x>y
B.x=y
C.x<y
D.编译错误
第3题:
设有如下程序: public class Sun { public static void main (String args[ ]) { int x,y; x= (int) Math.sqrt (2) /2+ (int) Math.random ()*2/2; y= (int) Math.sqrt (3) /3+ (int) Math.random ()*3/3; if (x>y) System.out.println ("x>y"); else if (x==y) System.out.println("x=y"); else System.out.println("x<y"); } } 程序运行的结果为( )。
A.x>y
B.x=y
C.x<y
D.以上都不对
第4题:
下面程序段的输出结果是______。 public class Test{ public static void main(String args[ ]){ int x,y; x=(int)Math.sqrt(5/2)+(int)Math.random( )*5/2; y=(int)Math.sqrt(3/2)+(int)Math.random( )*3/2; if(x>y) System.out.println("x>y"); else if(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }
A.x>y
B.x=y
C.x<y
D.编译错误
第5题:
What is odd is that they have perhaps most benefited from ambition — if not always their own then that of their parents and grandparents.
第6题:
package test1; public class Test1 { static int x = 42; } package test2; public class Test2 extends test1.Test1 { public static void main(String[] args) { System.out.println(“x = “ + x); } } What is the result?()
第7题:
public class Test { public static void main(String[] args) { int x = 0; assert (x > 0) ? “assertion failed” : “assertion passed”; System.out.println(“Finished”); } } What is the result?()
第8题:
ab
a/b
a + 2b
ba
(ab) a
第9题:
第10题:
from forward to aft
from aft to forward
at master's option
as per owner's instruction
第11题:
Compilation fails.
“odd” will always be output.
“even” will always be output.
“odd” will be output for odd values of x, and “even” for even values.
“even” will be output for add values of x, and “odd” for even values.
第12题:
第13题:
A.Compilationfails.
B.“odd”willalwaysbeoutput.
C.“even”willalwaysbeoutput.
D.“odd”willbeoutputforoddvaluesofx,and“even”forevenvalues.
E.“even”willbeoutputforaddvaluesofx,and“odd”forevenvalues.
第14题:
请编制函数ReadDa(()实现从文件IN83.DAT中读取1000个十进制整数到数组xx中。请编制函数 Compute()分别计算出xx中奇数的个数odd、奇数的平均值avel、偶数的平均值ave2及所有奇数的方差totfc的值。最后调用函数WrireDat()把结果输出到OUT83.DAT文件中。
计算方差的公式如下:

设N为奇数的个数,xx[i]为奇数,ave1为奇数的平均值。
原始数据的存放格式是:每行存放10个数,并用逗号隔开(每个数均大于0且小于等于2000)。
注意:部分源程序已给出。
请勿改动主函数main()和输写函数WriteDat()的内容。
试题程序:
include<stdio.h>
include<stdlib.h>
include<string.h>
define MAX 1000
int xx[MAX],odd=0,even=0;
double avel=0.0,ave2=0.0,totfc=0.0;
void WriteDat(void);
int ReadDat (void)
{
FILE *fp;
if ( (fp=fopen ("IN83. DAT", "r") ) ==NULL) return 1;
fclose (fp);
return 0;
}
void Compute (void)
{
}
void main( )
{
int i;
for (i=0; i<MAX; i++)
xx[i]=0;
if (ReadDat ())
{
printf ("数据文件IN83.DAT 不能打开!\007\n");
return;
}
Compute ();
printf ( "ODD=%d\nAVEl=%f\nAVE2=%f\nTOTFC=%f\n",odd,avel,ave2,totfc);
WriteDat ();
}
void WriteDat(void)
{
FILE *fp;
int i;
fp=fopen ("OUT83. DAT", "w");
fprintf (fp,"%d\n%lf\n%lf\n%lf\n",odd,avel,ave2,totfc);
fclose(fp);
}
第15题:
函数ReadDat()实现从文件IN.dat中读取1000个十进制整数到数组xx中;请编写函数 Compute()分别计算出数组xx中奇数的个数odd、偶数的个数even,以及所有数的平均值aver和方差totfc的值。最后调用函数WriteDat(),把结果输出到OUT. dat文件中。
计算方差的公式如下:

原始数据文件存放的格式是:每行存放10个数(每个数均大于0且小于等于2000),并用逗号隔开。
注意:部分源程序已经给出。请勿改动主函数main()、读函数ReadDat()和输出数据函数 WriteDat()的内容。
include <stdio. h>
include <stdlib. h>
include <string. h>
define MAX 1000
int xx[MAX], odd = 0, even = 0;
double aver = 0.0, totfc = 0.0;
void WriteDat(void);
int ReadDat(void)
{ FILE *fp;
int i, j;
if ((fp = fopen("IN. dat", "r")) == NULL)
return 1;
for (i=0; i<100; i++)
{ for (j=0; j<10; j++)
fscanf(fp, "%d,", &xx[i*10+j]);
fscanf(fp, "\n");
if (feof(fp))
break;
}
fclose(fp);
return 0;
}
void Compute(void)
{
}
void main ()
{ int i;
for (i=0; i<MAX; i++)
xx[i] = 0;
if (ReadDat())
{
printf (" 数据文件 IN. dar 不能打开! \007\n");
return;
}
Compute ( );
printf("odd=%d\neven=%d\naver=%f\ntotfc=%f\n", odd, even, aver, totfc);
WriteDat ();
}
void WriteDat(void)
{ FILE *fp;
fp = fopen("OUT.dat", "w");
fprintf(fp, "%d\n%d\n%f\n%f\n", odd, even, aver, totfc);
fclose (fp);
}
第16题:
请编制函数ReadDat()实现从文件IN93.DAT中读取1000个十进制整数到数组xx中。请编制函数 Compute()分别计算出xx中奇数的个数odd、偶数的个数even、平均值aver及方差totfc的值,最后调用函数WriteDat()把结果输出到OUT93.DAT文件中。
计算方差的公式如下:

原始数据的存放格式是:每行存放10个数,并用逗号隔开(每个数均大于0且小于等于2000)。
注意:部分源程序已给出。
请勿改动主函数main()和写函数WriteDat()的内容。
试题程序:
include<stdio.h>
include<stdlib.h>
include<string.h>
define MAX 1000
int xx[MAX],odd=0,even=0;
double aver=0.0,totfc=0.0;
void WriteDat(void);
int ReadDat(void)
{
FILE *fp;
if((fp=fopen("IN93.DAT","r"))==NULL
return 1;
fclose(fp);
return O;
}
void Compute(void)
{
}
void main( )
{
int i;
for(i=O;i<MAX;i++)
xx[i] =0;
if (ReadDat ( ) )
{
print f ("数据文件IN93.DAT不能打开! \007\n");
return;
}
Compute();
printf( "ODD=%d\nEVEN=%d\nAVER=%lf\nTOTFC=%lf\n",
odd, even,aver,totfc);
WriteDat();
}
void WriteDat(void)
{
FILE *fp;
int i;
fp=fopen("OUT93.DAT","w");
fprintf(fp,"%dln%dln%lf\n%lfkn",odd,even,aver,totfc);
fclose(fp);
}
第17题:
public void test(int x) { int odd = x%2; if (odd) { System.out.println(“odd); } else { System.out.println(“even”); } } Which statement is true?()
第18题:
有一个表格,如果匹配所有行数为偶数的,用even实现,奇数的用odd实现。()
第19题:
Ⅰ only
Ⅱonly
Ⅲ only
Ⅰ and Ⅱ
Ⅰand Ⅲ
第20题:
prime numbers
integers
empty set
composite numbers
whole numbers
第21题:
the shape of an unlighted buoy
the light color of a lighted buoy
the color of the topmost band
whether the number is odd or even
第22题:
None
I only
II only
III only
I, II, and III
第23题:
finished
Compilation fails.
An AssertionError is thrown and finished is output.
An AssertionError is thrown with the message “assertion failed”.
An AssertionError is thrown with the message “assertion passed”.
第24题:
I
I and II
I and III
II and III