Write a program which generates the table of a number given by user and then write
the table in a file named “table.dat”.
Write a program which read characters from keyboard and write in a file until user
input “enter key” from keyboard.
Two polynomials A and B are given, add two polynomials A and B
Sample Input 1
true
true
Sample Output 1
Grass Trimmed
Garden Cleaned
Watered Plants
Sample Input 2
true
false
Sample Output 2
Search Item in a Mart
Given an array
mart of objects in the prefilled code and categoryOfItem, item as inputs, create a JS promise, resolve with "Item Found" text, if the
categoryOfItem matches with the category and the corresponding items list includes the itemreject with "Category Not Found" text, if the
categoryOfItem does not match with any catergory in the martreject with "Item Not Found" text, if the
items list does not include item Use async/await and try/catch blocks.
Quick Tip
You can use array methods find() and includes().
Sample Input 1
pulses
green gram
Sample Output 1
Item Found
Sample Input 2
detergents
tide
Sample Output 2
Category Not Found
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.
The input will be a single line containing a string
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
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"
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
in c++ 1. Write a function named kids_game that plays the popular scissor, rock, paper game. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The function accept two argument, a randomly generated number 0, 1, or 2 representing scissor, rock, or paper and an integer which will be entered by user, that can only be 0, 1, or 2. The function will displays a message indicating whether the user or the computer wins, loses, or draws. Here are sample runs:
in c++ 1. Write a code which accept two floating point numbers as an argument. Calculate their modulus and return modulus to the main.