YHSS 2007
Mid Term
  1. Write a JavaScript program that prompts for a number and calculates its square and cube and prints the output as follows
Sample  output
            The no. entered: 5
            Its square        : 25
            Its cube           : 125                                                                                                   [5]

  1. Write a script that validates LoginId and password against hard coded values [LoginId= school and password = thimphu] and prints the following messages as per the conditions mentioned below.
Ø  If user does not enter any values the following message is printed in green color.
“SORRY! YOU CAN’T KEEP IT BLANK”
Ø  If user enters both  values correctly the following is printed in blue color
WELCOME TO MY WEB SITE.
HOPE YOU WILL ENJOY IT.
Ø  If one of the values is wrong then the following message is printed in red color.
“BOTH MUST BE CORRECT”..
Ø  Or else the message “SORRY YOU ARE RESTRICTED” is printed if none of the above conditions are fulfilled.                                                                                                            [10]

  1. Write JavaScript program that checks whether the name of the color entered is a primary color or not. [use appropriate variable names and messages]                                                                                [5]      

Computer Studies: Mid term; 2007

Posted on

Friday, October 12, 2012