Writing programs and debugging 
A wild pikacu appears. Can you write a program 
that would register his name and age? 
Var pika_name=____(“enter his name”) 
___ pika_age=____(“enter his ___”) 
Keywords to use: prompt,var, age, ;
Next section-document. 
write(___(0,20)); 
document.write(____); 
Keywords to use:name.substring,pika_age
Edit the program so if you enter 
an age over 5, he is too old to 
battle 
if(pika___>=?){ 
alert(“he's too old to fight”) 
else 
{ 
else alert(he's ok to battle) 
Keywords to use:}, “”
Edit the program so pikachu's 
name appears in uppercase 
Keywords to use:name.toUppercase 
Document.write(_______)
Insert an image into your program 
at the end and save as pika.html 
then test it.
Open a new html document and 
write a program that will divide 
any number entered by 3. 
Keywords to use: parseInt, document.write 
Remember / is used for divide. 
Var num=____(“enter a number”) 
num=____(num) 
Var math= num ____ 3 
Document.write(___)
Practice and debugging

Practice and debugging

  • 1.
    Writing programs anddebugging A wild pikacu appears. Can you write a program that would register his name and age? Var pika_name=____(“enter his name”) ___ pika_age=____(“enter his ___”) Keywords to use: prompt,var, age, ;
  • 2.
    Next section-document. write(___(0,20)); document.write(____); Keywords to use:name.substring,pika_age
  • 3.
    Edit the programso if you enter an age over 5, he is too old to battle if(pika___>=?){ alert(“he's too old to fight”) else { else alert(he's ok to battle) Keywords to use:}, “”
  • 4.
    Edit the programso pikachu's name appears in uppercase Keywords to use:name.toUppercase Document.write(_______)
  • 5.
    Insert an imageinto your program at the end and save as pika.html then test it.
  • 6.
    Open a newhtml document and write a program that will divide any number entered by 3. Keywords to use: parseInt, document.write Remember / is used for divide. Var num=____(“enter a number”) num=____(num) Var math= num ____ 3 Document.write(___)