委托类型DG1的定义为delegate float DG1(int a,ref double b);那么下列委托对象的创建表达式中合法的有:()。
第1题:
若主调用函数类型为double,被调用函数定义中没有进行函数类型说明,而return语句中的表达式类型为float型,则被调函数返回值的类型是()。
A.int型
B.float型
C.double型
D.由系统当时的情况而定
第2题:
分析以下程序执行结果【 】。
include<iostream.h>
int f (int x, int y){
return x,y;
}
double f (double x, double y) {
return x,y;
}
void main() {
int a=4, b=6;
double c=2.6, d=7.4;
cout<<f (a, b) <<","<<f (c, d) <<end1;
}
第3题:
下列程序运行后的输出结果是( )。
#include
using namespace std;
int fun(int x) { return x*x; }
double fun(double x,int y=2) { return x*y; }
int main()
{
int a=5;
double b= 1.2;
cout
}
A. 27.4
B.26.44
C. 12.4
D.程序有误
第4题:
下列程序的输出结果是【 】
include<iostream>
using namespace std;
int main()
{
int num=500;
int &ref=num;
ref +=100;
cout<<num<<end1;
return 0;
}
第5题:
在下列方法的定义中,正确的是 ( )
A.public double x(){..;return false;}
B.public static int x(double y){...}
C.void x(doubled){...;return d}
D.public static x(double a){..}
第6题:
有下列程序: int funl(double a){return a*=a;) int fun2(double x,double y) { double a=0,b=0; a=funl(x);b=funl(y);return(int)(a+h); } main {double w;w=fun2(1.1,2.0),……) 程序执行后变量w中的值是( )。
A.5.21
B.5
C.5.0
D.0.0
第7题:
声明一个委托类型public delegate int myCallBack(int x); 则以下语句可以和委托myCallBack绑定的方法是()
第8题:
You work as an application developer at Certkiller .com. You have been given the responsibility of creating a class named CalcSalary that will determine the salaries of Certkiller .com’s staff. The CalcSalary class includes methods to increment and decrement staff salaries. The following code is included in the CalcSalary class: public class CalcSalary { // for promotions public static bool IncrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary += Amount; return true; } else return false; } //for demotions public static bool DecrementSalary (Employee Emp, double Amount) { if (Emp.Status == QuarterlyReview.AboveGoals) Emp.Salary -= Amount; return true; } else return false; } } You would like to invoke the IncrementSalary and DecrementSalary methods dynamically at runtime from the sales manager application, and decide to create a delegate named SalaryDelegate to invoke them. You need to ensure that you use the appropriate code to declare the SalaryDelegate delegate.What is the correct line of code?()
第9题:
您已创建一个名为 CalcSalary,将确定 Certkiller.com 员工的薪酬类的责任。CalcSalary 类包括员工的薪酬递增和递减的方法。下面的代码包含在 CalcSalary 类中:()public class CalcSalary {// for promotionspublic static bool IncrementSalary (Employee Emp, double Amount){if (Emp.Status == QuarterlyReview.AboveGoals)Emp.Salary += Amount;return true;
第10题:
public delegate int PowerDeviceOn(bool result, DateTime autoPowerOff);
public delegate bool PowerDeviceOn(object sender, EventArgs autoPowerOff);
public delegate void PowerDeviceOn(DateTime autoPowerOff);
public delegate bool PowerDeviceOn(DateTime autoPowerOff);
第11题:
5.21
5
5.0
0.0
第12题:
public delegate int PowerDeviceOn(bool, DateTime);
public delegate bool PowerDeviceOn(Object, EventArgs);
public delegate void PowerDeviceOn(DateTime);
public delegate bool PowerDeviceOn(DateTime);
第13题:
A.public delegate int PowerDeviceOn(bool, DateTime);
B.public delegate bool PowerDeviceOn(Object, EventArgs);
C.public delegate void PowerDeviceOn(DateTime);
D.public delegate bool PowerDeviceOn(DateTime);
第14题:
有下列程序: int funl(double a){return a*=a;} int fun2(double x,double y) {double a=0,b=0; a=funl(x);b=funl(y);return(int)(a+b); } main( ) {double w;w=fun2(1.1,2.0),……} 程序执行后变量w中的值是( )。 、
A.5.21
B.5
C.5.0
D.0.0
第15题:
已知:double A(double A) {return++a;}和int A(in A) {return++a;}是一个函数模板的两个实例,则该函数模板定义为【 】
第16题:
有以下程序:int fun1 (double a){ return a * =a;}int fun2 ( double x, double y ){ double a=0,b=0; a = fun1 (x) ;b = fun1 (y); return(int) (a + b);} main() { doublew;w=fun2(1.1,2.0);……} 程序执行后变量w中的值是( )。
A.5.21
B.5
C.5
D.0
第17题:
有以下程序; int f1(double A) { return a*a; } int f2(double x,double y) { double a, b; a=n(x); b=f1(y); return a+b; } main() { double w; w=f2(1.1,2.0); ┇ } 变量w中的值是( )
A.5.21
B.5
C.5
D.0
第18题:
下列方法定义中,正确的是( )。
A.int x(int a,b)
B.double x(int a,int b) {return(a-b);){int w:w=a-b:}
C.double x(a,b)
D.int x (int a,int b) {return b}{return a-b;}
第19题:
You need to write a multicast delegate that accepts a DateTime argument.Which code segment should you use?()
第20题:
您需要编写可接受日期时间参数并返回一个布尔值,多路广播的委托。您应该使用哪个代码段?()
第21题:
public delegate bool Salary (Employee Emp, double Amount);
public bool Salary (Employee Emp, double Amount);
public event bool Salary (Employee Emp, double Amount);
public delegate void Salary (Employee Emp, double Amount);
第22题:
public delegate int PowerDeviceOn(bool result,DateTime autoPowerOff);
public delegate bool PowerDeviceOn(object sender,EventArgs autoPowerOff);
public delegate void PowerDeviceOn(DateTime autoPowerOff);
public delegate bool PowerDeviceOn(DateTime autoPowerOff);
第23题:
DG 1dg1=delegate {return 0.3;};
DG 1dg2=delegate {return a;};
DG 1dg3=delegate (int a,ref double b) {return a;};
DG 1dg4=delegate (int a,ref double b) {return a/b;};