网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
本题的功能是统计成绩不及格的人数,分数有89,90, 56,90,89,45。23,45,60,59,61。
public class javal{
public static void main(String[]args)(
int 3score={56。90。89,23,45,61,60,59};
int hum=0;
;
int i=0:
while( ){
if( )
sum++:
i++;
}
System.out.println(”<;60:”+sum);
}
}
参考答案
更多 “ 本题的功能是统计成绩不及格的人数,分数有89,90, 56,90,89,45。23,45,60,59,61。public class javal{public static void main(String[]args)(int 3score={56。90。89,23,45,61,60,59};int hum=0;;int i=0:while( ){if( )sum++:i++;}System.out.println(”<;60:”+sum);}} ” 相关考题
考题
本题的功能是将文件java2.java复制为文件java2.java.bak。 importjava.io.*; public class java2{ public static void main(String sarg[]){ try{File file=new File("java2.java.bak"); ; FilelnputStream rfile=new FilelnputStream("ja- va2.java"); FileOutputStream wfile=new FileOutputStream ("java2.java.bak"); int c; while( ) wfile.write((char)c); rfile.close; wfile.close; }catch(Exception e){System.out.println("读取文 件的时候发生错误!");} System.out.println("复制操作完成!"); } }
考题
有以下程序: included using namespace std; class Base { public: Base( ) { x=0; }
有以下程序:included<iostream>using namespace std;class Base{public:Base( ){x=0;}int x;};class Derived1:virtual public Base{public:Derived1( ){x=10;}};class Derived2:virtual public Base{public:Derived2( ){x=20;}};class Derived: public Derived1,protected Derived2{ };int main( ){Derived obj;cout<<obj. x<<endl;return 0;}该程序运行后的输出结果是______。
考题
下列程序片段中,能通过编译的是A.public abstract class Animal{ public void speak();}B.public abstract class Animal{ public void speak(){}}C.public class Animal{ public abstract void speak();}D.public abstract class Animal{ public abstract void speak(){}}
考题
下面是关于派生类声明的开始部分,其中正确的是A.class virtual B:public AB.virtual class B:public AC.class B:public A virtualD.class B:virtual public A
考题
下列虚基类的声明中正确的是( )。A.class virtual B:public AB.virtual class B:public AC.class B:public A virtualD.class B:virtual public A
考题
下面属于Class的方法有( )。A.public class getName()B.public classLoader getClassLoader()C.public class getComponentType()D.以上答案都正确
考题
有以下程序:include using namespace std; class Base { public: Base() { K=0; } int
有以下程序:include<iostream>using namespace std;class Base{public:Base(){K=0;}int x;};class Derivedl:virtual public Base{public:Derivedl(){x=10;}};class Derived2:virtua1 public Base
考题
下列程序片段中,能通过编译的是( )。A.public abstract class Animal{public void speak( );}B.public abstract class Animal{public void speak( ){};}C.public class Animal{pubilc abstract void speak( );}D.public abstract class Animal{pubile abstract void speak( ){};}
考题
下列虚基类的声明中,正确的是( )。A.class virtualB:public AB.virtual classB:public AC.class B:public A virtualD.class B:virtual public A
考题
有以下程序: include class A { intx; public: A(int a) { x=a;} friend class B;
有以下程序:include<iostream.h>class A{int x;public:A(int a){x=a;}friend class B;}class B{public:void print(A a){a. x--;cout<<a.x<<end1;}};void main(){A a(10);B b;b.print(a) ;}程序执行后的输出结果是【 】。
考题
有下列程序:includeusing namespace std;class ONE{ public:virtual void f(){COUt
有下列程序:include<iostream>using namespace std;class ONE{public:virtual void f(){COUt<<"1";}};c1assTWO:public ONE{public:TWO(){cout<<"2";}};class THREE:public TWO{pub
考题
本题利用递归方法求前n个自然数的和(n=lO)。 public class javal{ public static void main(String[]args){ int sum=add(10): System.out.println("1+2+…+9+10="+ sum); } public static int add( ){ if(n= =l){ ; } else ; } }
考题
本题的功能是求1~100的自然数的累加,并打印输出计算结果。public class javal{public static void main(String[]args){int sum=0;int i=1;for(;;){if( ){sum=sum+i:}else’;}System.OUt.println("sums="+sum);}}
考题
本题统计score[]={37,89,63,60,59,78,91)中成绩不及格的人数。public class javal{public static void main(String[]args){int score[]={37,89,63,60,59,78,91),int sum=0:int i=0;while(i<;score.length){if(score[i]>;=60){;;};i++;}System.OUt.println("below 60 sum:"+sum);}}
考题
本题的功能是计算l~10之间除了5以外的各个自然数的和。public class javal{public static void main(String[]args){int i=1int sum=0;while(i<;=10){if(i= =5){;;};i++;}System.out.println("sum="+sum);}}
考题
下列程序片段中,能通过编译的是( )。 A.public abstract class Animal{ public void speak;}S
下列程序片段中,能通过编译的是( )。A.public abstract class Animal{ public void speak;}B.public abstract class Animal{ public void speak{);}C.public class Animal{ pubilc abstract void speak;}D.public abstract class Animal{ pubile abstract void speak{};}
考题
( 11 )下列程序的功能是统计命令行参数的个数,请在下划线处填上适当的代码。public class Length{public static void main(String args[]){System.out.println( " number of String args: " +args. 【 11 】 );}}
考题
Which three demonstrate an “is a” relationship?() A、 public class X { } public class Y extends X { }B、 public interface Shape { } public interface Rectangle extends Shape{ }C、 public interface Color { } public class Shape { private Color color; }D、 public interface Species { } public class Animal { private Species species; }E、 public class Person { } public class Employee { public Employee(Person person) { }F、 interface Component { } class Container implements Component { private Component[] children; }
考题
Which two allow the class Thing to be instantiated using new Thing()?A、 public class Thing { }B、 public class Thing { public Thing() {} }C、 public class Thing { public Thing(void) {} }D、 public class Thing { public Thing(String s) {} }E、 public class Thing { public void Thing() {} public Thing(String s) {} }
考题
下面哪一个是正确的类的声明?()A、public void HH{…}B、public class Move(){…}C、public class void number{}D、public class Car{…}
考题
单选题统计成绩工作表中的不及格人数,可使用的函数是()A
COUNTIFB
COUNTC
SUMIFD
LEN
热门标签
最新试卷