找考题网-背景图
单项选择题

A.if(vip== 钻石会员 ){sale=6;}else{if(vip== 白金会员 ){sale=7}e……

var vip,sale;
switch(vip){
case "钻石会员":
sale = 6;
break;
case "白金会员":
sale = 7;
break;
case "黄金会员":
sale = 8;
break;
default:
sale = 0;
}
以上代码,可以取代它的if语句是()



A.if(vip=="钻石会员"){sale=6;}else{if(vip=="白金会员"){sale=7}else{sale=8}else{sale=0}}
B.if(vip=="钻石会员"){sale=6;}elseif(vip=="白金会员"){if(vip=="黄金会员"){sale=8;}else{sale=0;}}
C.if(vip=="钻石会员"){sale=6;}elseif(vip=="白金会员"){sale=7;}elseif(vip=="黄金会员"){sale=8;}else{sale=0;}