Javascript
Javascript
High Flying
High Flying
High Flying
India Flag
The National flag of India has three equal horizontal
bands - the top panel is India saffron (Kesari), the bottom
panel is India green and white middle band bearing at its
centre the design of Ashoka Chakra in navy blue colour
with 24 equally spaced spokes. It was adopted by the
Constituent Assembly on 22nd July 1947, when it became
the official flag of the Dominion of India. The flag was
subsequently retained as that of the Republic of India.
The flag is based on the Swaraj flag, a flag of the Indian
National Congress designed by Pingali Venkayya.
8. Read three types of data from users using the prompt box of JavaScript.
Find the greatest among 3 numbers using the 'if' statement.
9. Write a JavaScript program which iterates the integers from 1 to 100. But
for multiples of three prints, "CAR" instead of the number, and for the
multiples of five prints, "BUS". For numbers which are multiples of both
three and five, print "CARBUS". The result shows on the screen.
10.Create a web page to convert miles to kilometers using JavaScript. Read
the data using a text box and display the output in the textbox.
Miles = km * 0.62137
Km= mi / 0.62137
F= C * 9/5 +32
C= (F-32) *(5/9)
14. Write a JavaScript for loop that will iterate from 0 to 15. For each
iteration, it will check if the current number is odd or even, and display a
message on the screen.
15.Write a JavaScript for loop that will iterate from 0 to 15. For each
iteration, it will check if the current number is odd or even, and display a
message on the screen.
Sample Output:
"0 is even"
"1 is odd"
"2 is even"
----------
----------
16.Write a JavaScript function that reverse a number.
Example x = 32243;
Expected Output : 34223
17.Read data from users using a prompt box. Display the output in the alert
box.
F= C * 9/5 +32
C= (F-32) *(5/9)
21. Write a JavaScript for loop that will iterate from 0 to 15. For each iteration, it
will check if the current number is odd or even, and display a message to the
screen.
Sample Output :
"0 is even"
"1 is odd"
"2 is even"
----------
----------
22. Write a JavaScript function that reverses a given number. The result should
be shown in the alert box.
Example x = 32243;
Expected Output: 34223
23. Write a JavaScript program to read students’ marks for five subjects and
compute the average marks of the student. Then, this average is used to
determine the corresponding grade. Display the result in table format. Use
CSS and Table tag.
Range Grade
<60 F
61-69 D
71- 79 C
81- 89 B
90-100 A
Output:
24. Write a JavaScript program to compute the perimeter and area of a rectangle
with a height of 7 inches and width of 5 inches.
25. Write a JavaScript program to compute the perimeter and area of a circle with
a given radius
26.Write a JavaScript program that accepts an employee's ID, total worked
hours of a month and the amount Rs. 50 he received per hour. Print the
employee's ID and salary for a particular month.
27. Write a Java script program that accepts three integers and find the maximum
of three.
28. Write a java script program to calculate a bike’s average consumption from
the given total distance travelled (in km) and spent fuel (in litres)
Test Data :
Input total distance in km: 350
Input total fuel spent in litres: 5
Expected Output:
Average consumption (km/lt) 70.000
29. Write a java script program to convert a given integer (in seconds) to hours,
minutes and seconds
30. Write a java script program to convert a given integer (in days) to years,
months and days, assumes that all months have 30 days and all years have
365 days.
31. Write a java script program to check whether a given integer is positive even,
negative even, positive odd or negative odd. Print even if the number is 0.
32. Write a Java script program to check whether a given number is even or odd.
33. Write a java script program to check whether a given number is positive or
negative.
34. Write a java script program to read the age of a candidate and determine
whether it is eligible for casting his/her own vote. (>18 casting vote)
35. Write a program in C to calculate and print the Electricity bill of a given
customer. The customer id., name and unit consumed by the user should be
taken from the keyboard and display the total amount to pay to the customer.
The charge are as follow:
Unit Charge/unit
Test Data :
1001
James
800
Expected Output :
Customer IDNO :1001
Customer Name :James
unit Consumed :800
Amount Charges Rs. 2.00 per unit: 1600.00
Surcharge Amount: 240.00
Net Amount Paid by the Customer: 1840.00
36. Write a java script program to find the sum of n natural numbers using for loop
37. Write a java script program to find the sum of positive number using while
loop
38. Write a java script program, to find a sum of digit using while loop.
39. Write a java script program to display 1 to 5 using do-while loop
40. Write a function that takes a number as an argument. If the number is even
return true. Otherwise, return false.