更多"有如下程序: x = InputBox('Input valu"的相关试题:
[单项选择]有如下程序:
x = InputBox("Input value of x")
Select Case x
Case Is > 0
y=y+1
Case Is = 0
y=x + 2
Case Else
y=x + 3
End Select
Print x, y
运行时,从键盘输入-5,输出的结果是( )。
A. -5-2
B. -5-4
C. -5-3
D. -5-5
[单项选择]有如下程序:
x=-5
s=InputBox("input value of s:")
Select Case x
Case x
y=x+1
Case Is=0
y=x+2
Case Else
y=x+3
End Select
Print x; y
运行时,从键盘输入-5,输出的结果是______。
A. -5-2
B. -5-4
C. -5-3
D. -5-5
[单项选择]有如下程序:
infocase$= InputBox("Input one letter.")
Select Case infocase$
case“a”
grade$="Very good"
case“b”
grade$="Good”
case“C”
grade$=“OK”
case“d”
grade$="Qualified"
case Else
grade$=“Bab”
End Select
Print grade$
运行时从键盘上输入英文小写字母d后,输出的结果是( )。
A. Very good
B. Good
C. Bad
D. Qualified
[单项选择]有如下程序:
infocase$=InputBox("Input one letter:")
Select Case infocase$
Case"a"
grade$="Very good"
Case"b"
grade$="good"
Case"c"
grade$="OK"
Case"d"
grade$="Qualified"
Case Else
grade$="Bad"
End Select
Print grade$
运行时从键盘上输入英文小写字母d后,输出的结果是______。
A. Very good
B. Good
C. Bad
D. Qualified
[单项选择]有如下程序:
#include
usingnamespacestd;
intmain()
{
int*P;
*P=9:
cout<<"ThevalueatP:"<<*P;
return0;
}
编译运行程序将出现的情况是( )。
A. 编译时出现语法错误,不能生成可执行文件
B. 运行时一定输出ThevalueatP:9
C. 运行时一定输出ThevalueatP:*9
D. 运行时有可能出错
[单项选择]有如下程序:
#include
using namespace std;
class Boat;
class Car{
public:
Car(int i):weight(i){ }
friend int Total(const Car &c.const Boat &b); //①
private:
int weight;
};
class Boat{
public:
Boat(int i):weight(i){ }
friend int Total(const Car &c,const Boat &b);
private:
int weight;
};
int Total(const Car &c,const Boat &b){ //②
return c.weight+b.weight;
}
int main( ){
Car c(10);
Boat b(8);
cout<<"The total weight is"<A. 程序编译正确
B. 程序编译时语句①出错
C. 程序编译时语句②出错
D. 程序编译时语句③出错
[单项选择]如下程序是为变量i赋值。若程序的输出结果是180。请将程序补充完整。
注意:不改动程序结构,不得增行或删行。
class Base
int i;
Base( )
add(10);
void add(int v)
i+=v;
void print( )
System.out.println(i);
class Extension extends Base
Extension( )
add(______);
void add(int v)
i+=v*2;
public class ConstructTest3
public static void main(String args[])
bogo(new Extension( ));
static void bogo(Base b)
b.add(60);
b.print( );
[单项选择]有如下程序:
* * *主程序:P.prg* * * * * *子程序:P1.prg* * *
SET TALK OFF X2=X2+1
STORE 2 TO X1,X2,X3 DO P2
X1=Xl+1 X1:Xl+1
DO PI RETURN
xl+x2+x3 * * *子程序:P2.prg* * *
RETURN x3=x3+l
SET TALK ON RETURN TO MASTER
执行命令DOP后,屏幕显示的结果为( )。
A. 12
B. 15
C. 6
D. 5
[单项选择]有如下程序
#include
#include
using namespace std;
int main( )
cout<A. setprecision(3)
B. fixed
C. setfill(′*′)
D. setw(8)