Trekking Kit
Given an object
trekkingKit in the prefilled code and item item as an input, write a JS program to add the method isKitContains to the constructor function Trekking using the prototype.
The method
isKitContains checks whether the trekkingKit contains the given item.
Quick Tip
The Object.getOwnPropertyNames() method gives an array containing the properties of the object.
Input
The input will be a single line containing a string
item
Output
The output should be a single line containing a boolean value
Sample Input 1
ruckSackBag
Sample Output 1
true
Sample Input 2
surfboard
Sample Output 2
false
Hotel Bill
A Hotel is offering discounts to its customers.
Given charge per day
dayCharge based on category and numbers of days customer stayed days as inputs, write a JS arrow function to return the total bill with the discount.
Quick Tip
Apply discounts on the following basis,
Sample Input 1
200
3
Sample Output 1
570
Sample Input 2
180
1
Sample Output 2
180
Sample Input 2
400
6
Sample Output 2
2040
Unite Family
Given three objects
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"
Manufacturing Date
Given a expiry date
Sample Input 1
2020-01-21
8
Sample Output 1
21-5-2019
Sample Input 2
2021-11-12
2
Sample Output 2
12-9-2021
Hotel Bill
A Hotel is offering discounts to its customers.
Given charge per day
dayCharge based on category and numbers of days customer stayed days as inputs, write a JS arrow function to return the total bill with the discount.
Quick Tip
Apply discounts on the following basis,
Sample Input 1
200
3
Sample Output 1
570
Sample Input 2
180
1
Sample Output 2
180
Split and Replace
Given three strings
inputString, separator and replaceString as inputs. Write a JS program to split the
inputString with the given separator and replace strings in the resultant array with the replaceString whose length is greater than 7.
Quick Tip
Sample Input 1
JavaScript-is-amazing
-
Programming
Sample Output 1
Programming is amazing
Sample Input 2
The&Lion&King
&
Tiger
Sample Output 2
The Lion King
Check values in the Array is a String
Given an array
Sample Input 1
[ 'frozen', 'rock', 'stained', 'basket' ]
Sample Output 1
true
Sample Input 2
[ 'recycling', 70, 'pastime', 'animal' ]
Sample Output 2
false
Trekking Kit
Given an object
trekkingKit in the prefilled code and item item as an input, write a JS program to add the method isKitContains to the constructor function Trekking using the prototype.
The method
isKitContains checks whether the trekkingKit contains the given item.
Quick Tip
The Object.getOwnPropertyNames() method gives an array containing the properties of the object.
Input
The input will be a single line containing a string
item
Output
The output should be a single line containing a boolean value
Sample Input 1
ruckSackBag
Sample Output 1
true
Sample Input 2
surfboard
Sample Output 2
false
Area and Circumference of a Circle
Given radius
radius of a circle, write a JS constructor function with the methods getArea and getCircumference to calculate the area and circumference of the circle.
Note
The value of π = 3.14
Quick Tip
Use the formulae to calculate,
Area of circle = π * radius * radius
Circumference of circle = 2 * π * radius
Input
The input will be a single line containing a number radius
Output
The first line of output should contain the area of the circle
The second line of output should contain the circumference of the circle
Sample Input 1
7
Sample Output 1
153.86
43.96
Sample Input 2
25
Sample Output 2
1962.5
157
In this assignment, let's build a Book Search page by applying the concepts we learned till now.
Refer to the below image.
The page should perform the operation as shown in the following image link:-
https://assets.ccbp.in/frontend/content/dynamic-webapps/bookmark-maker-output.gif
Instructions:
Use this Background image:
https://assets.ccbp.in/frontend/dynamic-webapps/book-search-bg.png
CSS Colors used:
Text colors Hex code values used:
#323f4b
#ffffff
CSS Font families used:
please help me.