Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
591 views
27 pages
Java Programs 23 12-Aug-2023 1-36 PM-1
Uploaded by
jack
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Java programs 23 12-Aug-2023 1-36 PM-1 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
591 views
27 pages
Java Programs 23 12-Aug-2023 1-36 PM-1
Uploaded by
jack
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Java programs 23 12-Aug-2023 1-36 PM-1 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Java programs 23 12-Aug-2023 1-36 PM-1 For Later
You are on page 1
/ 27
Search
Fullscreen
-7P5 Information Technology (Science) 3.53 Advanced JavaSepy 4. . Write an event driven JavaScript program to display multiplication ang subtraction of two accepted number when the mouse is moved over the button, Ans. : Coding: ~ : :
Enter Ist Number .
[Enter IInd Number
" yalue="Calculate” onMouseMove="chk()">
‘
function chk() ( var ab,mul, sub; a=parselnt(fl.n1.value); lb=parsetnt(f1.n2.value); mul=a*b; sub=a-b; alert("Multiplication is "+mul); alert("Substraction is "+sub); Dd f : :) ps Information Technology (Science) oat Advanced JavaScript Output ES = 31 ea @ reste ee SEE €7¢ o File | ITS9202022-23/savascriptirg html Enter st Nuber ( er aeo® =) Enter Ind Number Z (Coie le 2, Write an event driven JavaScript program to display whether accepted number is even or odd. Ans.: Coding: I ”
Enter a Number
|
, | Output: eS i xt aes > © Fie | Fy1P%202022-23/savascipt/peg2htm! er POD: EneeaSamber=— 3. Write an event driven JavaScript program to display addition and subtraction two accepted numbers on click of a button. Ans.: Coding :
Enter Ist Number
Enter IInd Number
_1P$ Information Technology (Science) 356 Advanced JavaScript [
script type="text/javascript"> function chk() ( var a,b,add,sub; a=parselnt(f1.n1.value); -|b=parselnt(fl.n2.value); add=a+b; lsub=a-b; lalert("Addition is "+add); lalert("Substraction is "+sub); Output : © prozhimi XQ prcdhenl x 5 5G ie rae Les Assert tert Nonber(—— Emer find Number) (ean) vio er OB:{PS Information Technology (Science) 357 a Javaserigg 4. Write an event driven JavaScript program to display addition of numbers fro, 50 to 150 when the mouse is moved over a button. mi Ans.: Coding : 2
Addition of Numbers from 50 to 1
Output: . esa® Addition of Numbers from 50 to 150TPS Information Technology (Science) 5. Write an event driv 150, Ans. : Coding : eee 3.58 Advanced JavaSeript en JavaScript program to display even numbers between 50 to
Output: on
Enter a Number
TPS Information Technology (Science) Ad 3-61 vanced Javascrig Output: | | | © ravtm xe | [65 e Onl emseamacergton 2 & & O@ | [2.2 enemees fu | | 1, | | | | | 1 | 1 | | 1 | 7 \ | 8. accepted string. Write an event driv: characters from the accepted string, Ans.: Coding:
Enter Your Name
Output: © pesttnemt x + Enter a Number{ } © > © @ Fie! FyrPss%202022-23/avaccriptprgT html ee FOB: 10. Write an event driven JavaScript program to display area of a circle. ‘Accept radius from the user (area = 3.14xrx). Ans. : Coding:
3-64 Advanced JavaScript number" name="n1">
button” name="b1" value="Area of Circle" onClick= rea()">
| “coctipt type="text /javaseript"> function area() t var a.t,p=3.14; reparselnt(fl.n1.value); a=p'rT; alert("Area of Circle is "+a); 1 Output : Vag Sa oe © prsizhent x + e SO Fite | FyTPss5202022-23/iavascnpyprg2. @ 2 & & OB:PS Information Technology (Science) 3-65 Advanced JavaScripg 11. Write an event driven JavaScript program to display area of a rectangle. Accept length and breadth from the user (area = Ixb). Ans. : Coding:
Enter Length
[Enter Breadth
r s information Technology (Science) qpsintor y ) 3-66 Advanced JavaScript output: @ es" SO Fie | FrP59:202022-25/1avescipuprglanimt WS te ® OD e eet | Enter Breadth Enter Length 12. Write an event driven JavaScript program to display area of a triangle. Accept base and height from the user (area = 1/2xbxh). (eee Ans. : Coding :
Enter Base
Enter Height
Output: x + ee ee 73. Write an event driven JavaScript program to display perimeter of a rectangle. . Accept length and breadth from the user. (Perimeter = 2 X length +2 X Breadth) Ans.: Coding:
Enter Length '
Enter Breadth
JAdvanced JavaScript ccript type="text /javascript"> function per() { var Lb, |eparselnt(f1.n1.value); b=parselnt(f1.n2.value); |p=((2")+(2"b)); alert(‘Perimeter of Rectangle is "+p); 1 a a Output: © erpstten x Et ‘i CO bm est058 orencronry * Entre Breast Pecinetar of Recunigie 74, Write an event driven JavaScript program to display day of the week for variable "aay = 5. If the value of the day is changed it should be displayed. Use switch statement.3-69 {PS Information Technology (Science) Ans. : Coding : a |
Enter Day of the Week
|
}
Output: © reas ee SS Orie! reresx2e20222mmcipvessnn & * Oo Ener Day of the Week) 15. Write an event driven JavaScript program to display factori: mouse is moved on the button. Play factorial of number 35 when Ans. : Coding :
TPS Information Technology (Science) Advanced JavaScript
Output: © O bie Fempssz02022 23/arascrnupsgzthin! er eae: ox 16. Write an event driven JavaScript program to accept 2 numbers and STS number is greater, Coding : ICTYPE html» Information Technolog: (Science) Advanced javatecript Gorm name="f1">_ “Enter Ist Number
Enter IInd Number |
|
|
| | Output : Var saeoex © estore x + 5) © @ Fie) F/1PS8:202022-23/savascnpuprgsonim we te & O BE Ener Nonber[____J Enter Und Number)PS Information Technology (Science) 3-73 Advanced JavaScript 17. Write an event driven JavaScript program to accept number and determine if greater than 200 less than 200 or equal to 200. Ans. : Coding :
‘Enter a Number
[ppsintornasens py wane se Advanced JavaScript output: © ep2inem SO Fle FrrPssz02nR2.2a/arasenptorgsiNm oe OD: Ener a Number} | —_ 18. Write an event driven JavaScript program to accept pin code and check whether it is an integer. Ans. : Coding : /
:
Enter Pincode :
Output: © px935hrt x + Leo. * & > SO Fie | FyrPss202022-23/tavascriptiprg3shiml oe oe O DE Eater Pincode(_] (heck) 19. Write an event driven JavaScript. program to call a function after 3000 milliseconds and display text 'Hello' . Ans. : Coding :
l Output: xO wea, = © > G O-Fite | eyrPs%202022-23//avascriptyprascntmt ee ve OD 20. Write an event driven JavaScript program to open a new window with skyblue background color. Ans. : Coding :
Output : a * Uneitles lL © rg27.ntrat CS @ Fite | Fy1PS%202022-23/Javascript/prg37-htmt ee eo (eee 21. Write an event driven JavaScript program to display 2 colors after every 3000 milliseconds on click of a button. : EET) Ans. : Coding :
Output: | © eep36nen1 es \< SO Fie | rrp: #202022-23/avascriptiprg3@himl U2 22, Write an event driven Javascript program to display square root of a number using built-in function of math object. Ww Ans. : | of the text 24. Write an event driven Javascript program to display length “Information Technology” on click of a button. (March 2023) Ans.: