0% found this document useful (0 votes)
44 views1 page

COSC 326 Practical JavaScript 1

The document provides instructions for 5 JavaScript programming exercises to be completed as part of a Web Design, Development and Administration practical session on October 30th, 2023. The exercises include: 1) Determining if a number is even or odd; 2) Calculating the area of a circle given user input radius; 3) Calculating a salesperson's gross salary based on sales, commission rate, and bonuses; 4) Converting between centimeters and inches based on user selection; 5) Displaying county name and governor given user input county number by searching a data table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views1 page

COSC 326 Practical JavaScript 1

The document provides instructions for 5 JavaScript programming exercises to be completed as part of a Web Design, Development and Administration practical session on October 30th, 2023. The exercises include: 1) Determining if a number is even or odd; 2) Calculating the area of a circle given user input radius; 3) Calculating a salesperson's gross salary based on sales, commission rate, and bonuses; 4) Converting between centimeters and inches based on user selection; 5) Displaying county name and governor given user input county number by searching a data table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

COSC 326: WEB DESIGN, DEVELOPMENT AND ADMINISTRATION

PRACTICALS (COMPUTER LABS 1, 2, 3, 4, L4


MONDAY 30th OCTOBER 2023
1. Write a JavaScript program that prompts for the input of an integer value, then
determines if the number is an even number or an odd number.

2. Write a JavaScript program to find the area of a circle where radius is keyed in by the
user.

3. A sales person for a mobile handset selling company, earns a basic salary of 20,000 a
commission of 2% for all total sales for the months and a bonus of 30 for every handset
sold during the month. Write a JavaScript program to calculate the gross salary for a
worker at the end of the month when the number of handsets sold is keyed in.

4. Assuming 2.6 centimeters=1 inch. Using JavaScript’s conditional structures, write a


program that prompts a user to enter a number to be converted, then select either option 1
or option 2. If a user selects option 1 it converts the entered number from centimeters to
inches, while if the user enters option 2 it converts from inches to centimeters.

5. Consider the following table:


COUNTY NUMBER COUNTY NAME GOVERNOR
01 MOMBASA SHERIF NASSIR
12 MERU KAWIRA MWANGAZA
47 NAIROBI JOHNSON SAKAJA
16 MACHAKOS WAVINYA NDETI

Write a JavaScript program to accept the county number. The program should then
display the county name and governor based on the number entered

You might also like