Silicate Wielder
November 29th, 2012, 08:13 PM
Okay, I'm new to JS and I want to know how I can get this code to run using the command prompt as a console.
I'm using Codecademy to learn how to program in java, if that helps any.
//The program starts here.
var opsys = (prompt("What is your operating system?"));
var year = (prompt("Please enter the current year"));
if (opsys === "Windows");
{
console.log("You are running Windows");
}
if (opsys === "Linux");
{
console.log("You are running Linux");
}
if (opsys === "Mac");
{
console.log("You are running Macintosh");
}
console.log(year);
Please correct any errors if you find any.
I'm using Codecademy to learn how to program in java, if that helps any.
//The program starts here.
var opsys = (prompt("What is your operating system?"));
var year = (prompt("Please enter the current year"));
if (opsys === "Windows");
{
console.log("You are running Windows");
}
if (opsys === "Linux");
{
console.log("You are running Linux");
}
if (opsys === "Mac");
{
console.log("You are running Macintosh");
}
console.log(year);
Please correct any errors if you find any.