concatenate and remove Duplicates
Given two arrays arr1 and arr2 of positive integers write a JS program to concatenate two rows and remove duplicates from the concatenated array. Log the array with unique items in ascending order
input1
[1,4,7,3,7,3,3]
[2,4,5,5,3,2,1]
output1
[1,2,3,4,5,7]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let arr1 = JSON.parse(readLine());
let arr2 = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here and log the output */
}
The lateral area of a right cylindrical tank is 48πm2
and its volume is 72πm3.
Find the altitude of the tank.
State Raoults law
The function accepts two positive integers ‘r’ and ‘unit’ and a positive integer array ‘arr’ of size ‘n’ as its argument ‘r’ represents the number of rats present in an area, ‘unit’ is the amount of food each rat consumes and each ith element of array ‘arr’ represents the amount of food present in ‘i+1’ house number, where 0 <= i
240 dm3 of air at s.t.p is compressed to 17 atmospheres in a compression tube. Determine the volume in dm3 occupied in the tube.
Common arrays in three arrays
given three arrays arr1,arr2,arr3 write a JS program to find the common items in the among three arrays.
sample input1
[1,2,3,'cat']
[1,'cat',4]
[1,'cat,64]
output1
[1,'cat']
sample input2
['cat','rat','dog']
['lion','fox']
['kiwi','eagle']
output2
[]
function readLine() {
return inputString[currentLine++];
}
function main() {
let arr1 = JSON.parse(readLine().replace(/'/g, '"'));
let arr2 = JSON.parse(readLine().replace(/'/g, '"'));
let arr3 = JSON.parse(readLine().replace(/'/g, '"'));
/* Please do not modify anything above this line */
/* Write your code here */
}
Cumulative Sum
given an array integers, write a JS program to get the cumulative sum of the items in the array
sample input1
[1, 10, 100, 1000]
sample output1
[1, 11, 111, 1111]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString
.trim()
.split("\n")
.map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
let integers = JSON.parse(readLine());
/* Please do not modify anything above this line */
/* Write your code here */
}
Create a class Employee with basic_sal as its data member. Write a program to calculate the gross pay of an employee, with the allowances provided below.
Dearness Allowance = 21% of the Basic Pay
House Rent Allowance = 12% of Basic Pay
Provident Fund = 6.45% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Gross Pay = Net Pay − Provident Fund
Implement the program using the concept of Single Inheritance
Please someone help me with this program i am too frustrated solving this
P(X) = 1225X for 1, 2, 3, 4
Is it canbe serve or cannot serve, Explain.P(X) = 3 + X for x = 1, 2, 3, 4
3 – X