Your variables must be:
var subjectOne = 50;
var subjectTwo = 90;
var answer = (subjecOne + subjectTwo) / 2;
Salamat po ayusin ko na poYou have to call your function ate. See the image, the color red.
Thank you po itry ko poPlus mo pa na walang age() ka na tinatawag TS
Eto pa kasi binigay saamen ng prof naminPlus mo pa na walang age() ka na tinatawag TS
ano po course niyo para makapag isip isp po ako sa course ko po?May hands on kame tomorrow sa web dev 2 JavaScript
If else
Switch
If else if statement po bukas sana nga maipasa ko e dito palang hirap na ako e
I.tano po course niyo para makapag isip isp po ako sa course ko po?
Ayaw boss e check mo nga toGanito kasi. May isang .html file ka na may nakalink na isang external JS na file.
Sa loob ng JS mo, may function kang tinawag.
In the first place, hindi talaga gagana ang app mo dahil ang function, na hindi tinawag, hindi naman magrrun, in simple terms.
May function, may magc-call.
So may function age() ka, dapat sa body ng html file mo, may ganito kang script.
<script>
age();
</script>
Ngayon, pasok tayo sa function age mo.
Ang unang mali dyan, may subject ka na initialized mo.
Pero sa loob ng ans variable, may subject1 & subject2 kana.
I think, mali ang naming mo.
Dapat sa halip na subject parehas, subject1 and subject2 ang sagot para magfit doon sa variable ans formula.
Double initialization ang ginawa mo, doon pa lang, error na.
Sa if else mo naman, ang problem is walang delimiter.
Dapat, document.write("PASSED");
saka document.write("FAILED");
May semi colon.
More power sa'yo and don't give up!
ganiyan ren po kukuhanin ko HINTYAIN NIYO PO AKO MAGPAPATURO PO AKO sa inoyI.t
Information technology po
Html at css lang po alam ko newbie pa ako sa JavaScript at java lolganiyan ren po kukuhanin ko HINTYAIN NIYO PO AKO MAGPAPATURO PO AKO sa inoy
<!DOCTYPE html>
<html lang="en">
<head>
<title>Javascript</title>
</head>
<body>
<script>
//create a program to determine if the age is qualified to vote
//function to check if the voter is qaulified or not
function age(age) {
if (age >= 18) {
document.write("<h3 style='color: red;'>Your age is " + age + " and you are qualified to vote." + "</h3>");
}
else {
document.write("<h3 style='color: red;'>Your age is " + age + " and you are not qualified to vote." + "</h3>");
}
}
//call the function
age(18)
age(25)
age(17)
</script>
</body>
</html>
Code:<!DOCTYPE html> <html lang="en"> <head> <title>Javascript</title> </head> <body> <script> //create a program to determine if the age is qualified to vote //function to check if the voter is qaulified or not function age(age) { if (age >= 18) { document.write("<h3 style='color: red;'>Your age is " + age + " and you are qualified to vote." + "</h3>"); } else { document.write("<h3 style='color: red;'>Your age is " + age + " and you are not qualified to vote." + "</h3>"); } } //call the function age(18) age(25) age(17) </script> </body> </html>
Sir pahinge nga po sample ng external niyo?Code:<!DOCTYPE html> <html lang="en"> <head> <title>Javascript</title> </head> <body> <script> //create a program to determine if the age is qualified to vote //function to check if the voter is qaulified or not function age(age) { if (age >= 18) { document.write("<h3 style='color: red;'>Your age is " + age + " and you are qualified to vote." + "</h3>"); } else { document.write("<h3 style='color: red;'>Your age is " + age + " and you are not qualified to vote." + "</h3>"); } } //call the function age(18) age(25) age(17) </script> </body> </html>
Sample lang lang po ng external JavaScript code lang po yun kasi ihandson din saamen bukas eTeka ginagawan na kita
Eto poPa try code mo ate, gusto ko pa matuto,kahit questions lang
Malapit na ako sa balay, update kita maya ateEto po
<!DOCTYPE html>
<html lang="en">
<head>
<title>Javascript</title>
</head>
<body>
<script>
//create a program to determine if the age is qualified to vote
//function to check if the voter is qaulified or not
function age(age) {
if (age >= 18) {
document.write("<h3 style='color: red;'>Your age is " + age + " and you are qualified to vote." + "</h3>");
}
else {
document.write("<h3 style='color: red;'>Your age is " + age + " and you are not qualified to vote." + "</h3>");
}
}
//call the function
age(18)
age(25)
age(17)
</script>
</body>
</html>
Hinde ito saaken
Galingan mo poMalapit na ako sa balay, update kita maya ate