javascript 大神快来 ,编程高手进

//Challenge5//Iftheuserenterseitherblueorgreen,alert"YoulikethesamecolorasMr.Weinberg... //Challenge 5
//If the user enters either blue or green, alert "You like the same color as Mr. Weinberg!". Otherwise, alert "That color is nice. It isn't as nice as blue or green." .

function challenge5(){

var myColor = prompt("What is your favorite color?");
if(){

alert("You like the same color as Mr. Weinberg!");

}

else{

alert("That color is nice. It isn't as nice as blue or green.");

}

}

//Challenge 6
//Write a program that tells the user which advisor they have based on the grade that is entered. The first is done for you.
//These are the grades: Grade 6 - Mr. Sanchez & Mr. Mullen
//Grade 7 - Mr. Haag & Mr. Hoversen
//Grade 8 - Mr. Deerwester & Mrs. Gemmell
//Grade 9 - Mrs. Mullen & Mr. Searle
//Grade 10 - Mr. Fox & Mrs. Rooth
//Grade 11 - Ms. Payne
//Grade 12 - Mr. Weinberg

function challenge6(){

var myGrade = parseInt(prompt("Enter your grade:"));
if(myGrade==6){
console.log("Your advisor is Mr. Mullen or Mr. Fox.");

}
else if(){

}

}

//Challenge 7
//The day of the week is stored in the variable dayOfWeek. 0 is Sunday, 6 is Saturday.
//If the day of the week is either Sunday or Saturday, print out "It's the weekend - sleep as late as you want!". Otherwise print "Today is a school day." to the console.

function challenge7(){

var today = new Date()
var dayOfWeek = today.getDay();

//your code goes here.

}
展开
 我来答
地球仪826
2014-10-15 · TA获得超过101个赞
知道答主
回答量:146
采纳率:0%
帮助的人:94.6万
展开全部
Challenge 5

if(myColor == "blue"||myColor == "green"){

alert("You like the same color as Mr. Weinberg!");

}

c 6
else if(myGrade == 7){
console.log("Mr. Haag & Mr. Hoverse");
}
c7
好好想想吧,就是if else
追问
能不能给我整个,你这个我不知道怎么用。。谢谢大神
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式