Il 0% ha trovato utile questo documento (0 voti)
14 visualizzazioni31 pagine

S 24 Model CSS

Model of client side scripting language of computer engineering Third year diploma

Caricato da

labadeshravani
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato PDF o leggi online su Scribd
Il 0% ha trovato utile questo documento (0 voti)
14 visualizzazioni31 pagine

S 24 Model CSS

Model of client side scripting language of computer engineering Third year diploma

Caricato da

labadeshravani
Copyright
© © All Rights Reserved
Per noi i diritti sui contenuti sono una cosa seria. Se sospetti che questo contenuto sia tuo, rivendicalo qui.
Formati disponibili
Scarica in formato PDF o leggi online su Scribd
Sei sulla pagina 1/ 31
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISOMEC - 27001 - 2005 Certified) SUMMER ~ 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: |_22519 tant Instr 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate may vary but the examiner may try to assess the understanding level of the candidate. 3) The language errors such as grammatical, spelling errors should not be given more importance (Not applicable for subject English and Communication Skill. 4) While assessing figures, examiner may give credit for principal components indicated in the figure. The figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn 5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and there may be some difference in the candidate's answers and model answer. 6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on candidate's understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept. 8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual (English + Marathi) medium is introduced at first year of AICTE diploma Programme trom academic year 2021-2022. Hence if the students in first year (first and second semesters) write answers in Marathi or bilingual language (English +Marathi), the Examiner shall consider the same and assess the answer based on matching of concepts with model answer. Q./ Sub Answer Marking No| Q.N. Scheme Attempt any of the following: 10 a) | Writefeatures of JavaScript 2M Ans. | I. It isan object-based scripting language. Any 2 features 2. Igives the user more control over the browser. 1M each 3. Itis light weighted. 4. Client ~ Side Technology 5. JavaScript is interpreter based scripting language, 6. JavaScript is case sensitive. 7. JavaScript is object based language as it provides. predefined objects, b List and describe any four methods of Math object 2M Page 1/30 Tasemeioaitornectomn Gy studocu Downloaded by Sekaccount (awed ATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISOAEC - 27001 - 2005 Certified) MAHARASHTRA SUMMER ~ 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: | 22519 Ans. ‘Math, round(value)- It returns value rounded to its nearest integer. Math.ceil(value)- It returns value rounded up to its nearest int Math.floor(value)- It returns value rounded down to its nearest Any integer Math.trune(Value)- It returns value as integ Math.pow (number, power) It returns value as power of specified number. Math. sqrt(value)- It retums sq Math.abs(value)- It returns absolute ~positive value for given value. Math.min ()- It retums lowest value in a list of values. Math.max ()- It returns highest value in a list of values. er part of value. ure root of value 4 methods 12M each ° Ans. Write a JavaScript program that will print even numbers from 1 1020 Note: Any other relevant logic shall be considered texUjavascript"> 1.is=20:i+4) if(i%2==0) t document.write(i#"'sbr™"): } } “script sshuml> 2M Correct program 2M qd) Ans, Write a JavaScript program to display the elements of array in ascending and descending order. Note: Any other relevant logic shall be considered s/himl> 4M Correct logic 2M Correct syntax 2M Downloaded by Stkaccount (awei4s:k@gmailcom) Page 6/30 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001 - 2005 Certified) SUMMER ~ 2024 EXAMINATION MODEL ANSWER 22519 Subject: Client Side Scripting Language Subject Code: d) | State the use of following methods: 4M i) charCodeau ) Use of each ii) fromCharCode ( ) method 2M I charCodeAt( ): This method is used to retum a unicode of specified character. Syntax: var code=letter.charCodeAt( ): Example: var ch="a" documentvrite(ch.charCodeAt( )): Ans. Output: 97 2. fromCharCode( ): This method is used to return a character for specified code, Syntax: var character=String.fromCharCode(code ); Example: var character=String.romCharCode(97 Document.writeveh); Output: a 4M 3. Attempt any THREE of the follow a) | Explain Associative arrays in deta Ans, | Associative arrays are basically objects in JavaScript where indexes are replaced by user-defined k Syntax: var arr = {key :'valuel’, key Here, arr, is an associative array with key, key2 being its keys or Correct 1e2'] explanation iM {J value! & value 2 are its elements. r= | "Company Name": *Flexiple’, "ID": 123}; string indexes a Example: vai The content or values of associative arrays is accessed by keys. An associative array is an array with string keys rather than numeric keys. For example: var arrAssociative “Company Name "ID": 123 ‘Flexiple’ Page 7/30 Piscammomisotedcenn EY studocu Downioaded by Srkaccount (awe)4srk@gmail com) MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) CISOMEC - 27001 - 2005 Certified) SUMMER ~ 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: |_22519 var arrNormal "Flexiple", 123]; Here, the keys of the associative array are “Company Name” & “ID whereas in the normal array. The keys or index is 0 & 1 b) | Write a JavaScript function that checks whether a passed string 4M is palindrome or not. . Ans. | Note: Any other relevant logic shall be considered en function isPalindrome(str) | . str = strep 1-20-9)/g,").toLowerCase(); a return str === str.split(").reverse() joint’), ~ | console.log(isPalindrome("A man, a plan, a canal, Panama"); // Output: true console Jog(isPalindrome("racecar")), // Output: tue console log(isPalindrome("hello")); # Output: false c) | Explain how to add and sort elements 4M example. Ans. | Adding Elements to an Array: In JavaScript, you can add elements to an array using vari Bsplenation methods, stich as push(), unshifi(), or direct assignment to a specific | yuan index. suitable Using push(): example The push() method adds one or more elements to the end of an array | Any one and returns the new length of the array method Using unshift(): ow The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array Using splice(): This method can be used to add new items to an array, and removes elements from an array. Syntax: arr splice(start_index.removed_elements.list_of_elemnts_to_be_add ed): Page 8/30 Downloaded by Srkaccount (awe4stk@gmailcom) MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001 - 2005 Certified) SUMMER - 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: |_22519 Parameter +The first parameter defines the position where new elements should be added (spliced in) *The second parameter defines how many elements should be removed *The list_of_elemnts to be added parameter define the new elements to be added( optional). Using length property: The length property provides an easy way to append a new clement toanamay. Example s/huml> ©) _ | Explain how to use banners for displaying advertisement. 4M Ans. | Following are the steps to insert banner advertisement in webpa, Page 16 /30 Downloaded by Srka MAHARASHTRA STATE BOARD OF TECHNICAL. (Autonomous) (ISO/IEC - 27001 - 2005 Certit d) DUCATION SUMMER - 2024 EXAMINATION MODEL ANSWER Subject: Client Side Set ig Language Subject Code: |_22519 1) Create banner advertisement using a graphics tool such as ie PhototShop, Paint, etc “un 2) Create an element in web page with height and width to display banner advertisement. 3) Build JavaScript that loads and display banner advertisements. shead> Stitle>Banner Advertisements s/ttle> d) | Write a JavaScript function to check whether a given address is) 4M a valid IP address or not. Ans. | Note: Any other relevant logic shall be considered function isValidIPAddress(address) { Correct logic Tn camer mae he fcr on G studocu Downloaded by Sikaccount (awe}4er const ipv4Regex = /M\d{ 1.3} Md) 1.3 ))Ad{ 1.3 Md 1.3) 8%: 2M const match = address.match(ipv4Regex): Correct syntax if (match) ( ou for (let i= 1s i= 4: 144) ( const part = parselnt(mateh|i]): if (part < 0 || part > 255 |] isNaN(par)) | return false; // Invalid part t I return ue; Jelse { return false; ) | Page 17/30 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autono ) (ISO/IEC - 27001 - 2005 Certified) SUMMER - 2024 EXAMINATION MODEL ANSWER ‘Subject: Client Side Scripting Language Subject Code: _22519 ©) | Explain process to create status bar in JavaScript. 4M Ans. | Status Bar: The status bar is located at the bottom of the browser window and is | __ Correet used to display a short message to visitors on a web page. | “unten Developers who are clever to utilize the status bar employ various techniques to incorporate the status bar in the design of their web page. Some developers display « message on the status bar when the web page first opens. Other developers might change the message to reflect whatever the visitor is doing on the web page. For example, if user is filling registration form then status bar will display a text as “User is on form filling section’ Building a Static Message: A static message appears when the web page opens and remains on the status bar until the web page is closed. The content of the status bar is the value of the window object's status property To display a message on the status bar, assign the message to the status property of the window object. Example: window.status= "You are on home page’; Hello welcome to JavaScripts/l> s/ouml> 5 Attempt any TWO of the following: 12 a) Write HTML script that displays textboxes for accepting 6M username and password. Write proper JavaScript such that when the user clicks on submit button Page 18/30 Downloaded by Seka (awelssek@grallcom wa MAHARASHTRA STATE OARD OF TECHNICAL EDUCATION som Subject: Client Side Scripting Lan; Subject Code: | 22519 risdeanmsemitioteeteterses GY studocu Downloaded by Sikaccount (awe}4srk@gmailcom All texthoxes must get disabled and change the color to “RED: and with respective labets ii) Prompt the error message if the password is less than characters Ans, | Note: Any other relevant logic shall be considered Creme shtmi> err Shead> Siscrip TextArea: The Textarea object represents an HTML stextarea> element The stextarca> tag indicates a form field where the user can enter a large amount of text. You can access a stextarea> element by using getElementByld() Exampk shtml> Stextareacols="30" row: wrap="hard” readonly disabled="yes"> As you can see many times word wrapping is often the desired look for your textareas, Since it makes everything nice and easy to read and preserves line breaks. This document voreaswe Gy studocu Downloaded by Sckaccount (awe Page 23/30 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001 - 2005 Certified) SUMMER - 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: | 22519 s/html> Text: Input “text” is an object to enter a single line of text whose content will be part of form data. In huml a text is created by following code: jextname” —id="textid” value=" Exau sscript type="text/javascript"> function changeText() { var userlnpul Jocument getElementById(‘userInput’).value; document getElementByld(vp’).innerHTML = userInput; ) S/script> input type='text’id=userlnpul’ Value="Enter Text Here’ />

Welcome sb id='vp"JavaSeript

input type=button’ onclick=changeText()’ value=Change Text’ Siscript> TextArea: The Textarea object represents an HTML tag indicates a form f large amount of text. You can access a Stextarea> clement by using getElementById() ea> element. Id where the user can enter a Example: Stextareacols="30" rows=" 5” wrap="hard” —readonl disabled="yes"> As you can sce many times word wrapping is often the desired look for your textareas. Since it makes everything nice and easy to read and preserves line breaks, Page 23/30 This document i ola el charge on § studocu Downloased by Se count (aweidsrk@gmail com) HNICAL EDUCATION MAHARASHTRA STATE BOARD OF (Autonomous) (ISO/IEC - 27001 - 2005 Cert ) SUMMER ~ 2024 EXAMINATION MODEL ANSWER Subject: Client Side Scripting Language Subject Code: |_22519 Sextarea> sfauml> Checkbox: elements of type checkbox are rendered by default as boxes that are checked (ticked) when activated. A checkbox allows you to select single values for submission in a form (or not) Syntax for ereating checkbox is: Example: shtmi>


‘co">Computer Enggs/label>
” program” id ctronies
"Validate /button> "ej" value="EJ">