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.
} 展开
//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.
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询