A book store maintains the list of all its Books using XML. A Book consists of an ISBN number, which can be used as its attribute in the XML document. The following information is stored about the Book - book title, list of authors, name of the publisher and price of the Book. Create an XML document containing information of five Books. Also create the DTD to verify the XML document created by you
String Slicing
Given two strings
Check Whether the input string includes the substring using if condition and includes().
if the input string includes the substring then, find the index of the substring in the input string, using the indexof() and store the index in a variable.
slice the input string, using the slice() form index to the length of the input string and store in the variable slicedString. console the variable sliceString.
If the input string doesn't include the substring then else console the input string.
Unite Family: Given three objects father, mother, and child, write a JS program to concatenate all the objects into the family object using the spread operator.Input: The first line of input contains an object father, The second line of input contains an object mother
Sample Input
{'surname' : 'Jones', 'city': 'Los Angeles'}
{'dish': 'puddings'}
{'pet': 'Peter'}
Sample Output
Mr and Mrs Jones went to a picnic in Los Angeles with a boy and a pet Peter. Mrs Jones made a special dish "puddings". Use spread operator to combine the input object to form a single object family. So that all the keys and values of father, mother, child will be in family object
String Slicing: Given two strings inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString.Input: The first line of input contains a string inputString. The second line of input contains a string subString. Output: The output should be a sliced string or inputString (if the inputString does not include the subString)
.Follow the below approach to solve the String Slicing. Check Whether the input string includes the substring using if condition and includes().if the input string includes the substring then,Find the index of the substring in the input string, using the indexof() and store the index in a variable.slice the input string, using the slice() form index to the length of the input string and store in the variable slicedString. const slicedString = inputString.slice(index, inputString.length); console the variable sliceString.if the input string doesn't include the substring then else console the input string
Given two boolean values
isGrassTrimmerFound and isWaterHosePipeFound as inputs, create three JS promises using async/await and try/catch blocks.
Input
The first line of input contains a boolean isGrassTrimmerFound
The second line of input contains a boolean isWaterHosePipeFound
Sample Input 1
true
true
Sample Output 1
Grass Trimmed
Garden Cleaned
Watered Plants
Sample Input 2
true
false
Sample Output 2
Grass Trimmed
Garden Cleaned
Water Hose Pipe Not Found
Write a program for the Armstrong number
Given principal amount
principal as an input, time period in years time and appreciation percentage apprPercentage as optional inputs, write a JS function to return the final value finalValue with the given appreciation percentage and time period. The default values for time and apprPercentage are 2 and 5 respectively.
Quick Tip
The formula to calculate the final value with appreciation is,
finalValue = principal * (1 + time * appreciation / 100)
Explain about control and looping structure with an example program?
How to create a multi-line text entry in form design with an example program
(use the facilities of the <INPUT> and <TEXTAREA> tags to prompt the user by
including placeholder information in the text fields and text area.)