指出以下程式的錯處:
1. 找出由寶林至北角港鐵單程票應繳付的款項:
var type; fare;
type = prompt( );
if(type = 成人){
fare = =9.5;
} else {
fare = 4.8;
}
alert(fare);
2.找出會考等級(A,B,C,D,E,F,U)對應評語:
var grade;
grade = prompt( );
if(grade = A){
comment = 'Distinction';
}
if(grade = = 'B' && grade = = 'C'){
comment = = 'Credit';
}
if(grade > 'D' and < 'F') {
comment= 'Pass';
}else{
comment = 'Fail';
}
alert ('comment');