Which two are valid declarations of a float?()A、 float f = 1F;B、 float f = 1.0.;C、 float f = ‘1’;D、 float f = “1”;E、 float f = 1.0d;
Which two are valid declarations of a float?()
- A、 float f = 1F;
- B、 float f = 1.0.;
- C、 float f = ‘1’;
- D、 float f = “1”;
- E、 float f = 1.0d;
相关考题:
请选出创建数组的正确语句。() A.float f[][] = new float[6][6];B.float []f[] = new float[6][6];C.float f[][] = new float[][6];D.float [][]f = new float[6][6];
下面______不是创建数组的正确语句。A.float f[] f[] = new float[5][5];B.float f[][] = new float[5][5];C.float f[][] = new float[][5],D.float [][] f= new float[5][];
有以下程序: float f1(float n) { return n*n; } float f2(float n) { return 2*n; } main() {float(*p1)(float),(*p2)(float),(*t)(float),y1,y2; p1:f1; p2=f2; y1=p2(p1(2.0)); t=p1; p1=p2; p2=t; y2=p2(p1(2.0)); printf("%3.0f,%3.0f\n",y1,y2); } 程序运行后的输出结果是 ______。A.8, 16B.8, 8C.16, 16D.4, 8
在C++语言中,若类C中定义了一个方法int (int a,int b),那么方法(1)不能与该方法同时存在于类C中。A.int f(int x,int y)B.int f(float a,int b)C.float f(int x,float y)D.int f(int x,float y)
有以下程序 float fl(float n) { return n*n; } float f2(float n) { return 2*n;} main() {float(*p1)(float),(*p2)(float),(*t)(float),y1,Y2; p1=f1; p2=f2; y1=p2(p1(2.O)); t=p1; p1=p2; p2=t; y2=p2(pl(2.0)); printf("%3.0f,%3,Of\n",y1,y2); } 程序运行后的输出结果是A.8,16B.8,8C.16,16D.4,8
有以下程序:include float f1 (float n ){return n*n;}float f2 ( float n){return 2 有以下程序:#include <stdio.h>float f1 (float n ){ return n*n;}float f2 ( float n){ return 2 * n;}main( ){ float ( * p1)(float),( * p2)(float),(*t)(float) ,y1,y2; p1 = f1;p2 = f2; y1 = p2(p1(2.0) ); t =p1;p1 = p2;p2 =t; y2=p2(p1(2.0)); prinff("% 3.0f, %3.Of\n" ,y1,y2);}程序运行后的输出结果是( )。A.8,16B.8,8C.16,16D.4,8
下面程序输出的结果是( )。 include using namespace std; int test(int n1 下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main(){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }A.12.5B.7.5C.6.25D.25
下列程序语句中,不正确的是______。A.maia() { float a,b,c; scanf("%f,%f",a,b); c=add(a,b); …… } int add(float x,float y) {……}B.main() { float a,b,c; scanf("%f,%f",a,b); c=add(a,b); …… } float add(float x,float y) {……}C.float add() maia() { float a,b,c; scanf("%f,%f",a,b); c=add(a,b); …… } float add(float x,float y) {……}D.float add(float x, float y) {……} main() { float a,b,c; scanf("%f,%f",a,b); c=add(a, b); …… }
1. class BaseClass { 2. private float x = 1.of; 3. protected float getVar() { return x; } 4. } 5. class SubClass extends BaseClass { 6. private float x = 2.Of; 7. // insert code here 8. } Which two are valid examples of method overriding when inserted at line 7?() A、 float getVar() { return x; }B、 public float getVar() { return x; }C、 public double getVar() { return x; }D、 protected float getVar() { return x; }E、 public float getVar(float f) { return f; }
float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?() A、 f[0] = f0;B、 f[0] = farray;C、 f[0] = farray[0];D、 f[0] = farray[0][0];
Which the three are valid declarations of a float?()A、 float foo = -1;B、 float foo = 1.0;C、 float foo = 42el:D、 float foo = 2.02f:E、 float foo = 3.03d:
假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()A、x==(int)(float)xB、d==(double)(float)dC、f==(float)(double)fD、(f+d)-f==d
下列选项中,能有效地描述浮点数的有()。A、Float foo = -1;B、Float foo = 1.0;C、Float foo = 42e1;D、Float foo = 2.02f;E、Float foo = 3.03d;F、Float foo = 0x0123;
Which three are valid declarations of a float? () A、 Float foo = -1;B、 Float foo = 1.0;C、 Float foo = 42e1;D、 Float foo = 2.02f;E、 Float foo = 3.03d;F、 Float foo = 0x0123;
Which two cause a compiler error?() A、 float[] = new float(3);B、 float f2[] = new float[];C、 float[] f1 = new float[3];D、 float f3[] = new float[3];E、 float f5[] = { 1.0f, 2.0f, 2.0f };F、 float f4[] = new float[] { 1.0f. 2.0f. 3.0f};
class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?() A、 Void setVar(float f) {x = f;}B、 Public void setVar(int f) {x = f;}C、 Public void setVar(float f) {x = f;}D、 Public double setVar(float f) {x = f;}E、 Public final void setVar(float f) {x = f;}F、 Protected float setVar() {x=3.0f; return 3.0f; }
多选题Which two are valid declarations of a float?()Afloat f = 1F;Bfloat f = 1.0.;Cfloat f = ‘1’;Dfloat f = “1”;Efloat f = 1.0d;
多选题class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here 16. } Which two are valid examples of method overriding?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }
单选题假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()Ax==(int)(float)xBd==(double)(float)dCf==(float)(double)fD(f+d)-f==d
多选题Which two cause a compiler error?()Afloat[] = new float(3);Bfloat f2[] = new float[];Cfloat[] f1 = new float[3];Dfloat f3[] = new float[3];Efloat f5[] = { 1.0f, 2.0f, 2.0f };Ffloat f4[] = new float[] { 1.0f. 2.0f. 3.0f};
多选题1. class BaseClass { 2. private float x = 1.of; 3. protected float getVar() { return x; } 4. } 5. class SubClass extends BaseClass { 6. private float x = 2.Of; 7. // insert code here 8. } Which two are valid examples of method overriding when inserted at line 7?()Afloat getVar() { return x; }Bpublic float getVar() { return x; }Cpublic double getVar() { return x; }Dprotected float getVar() { return x; }Epublic float getVar(float f) { return f; }
单选题float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?()A f[0] = f0;B f[0] = farray;C f[0] = farray[0];D f[0] = farray[0][0];
多选题class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }