Make a website using HTML and CSS all about Zombies
1 Input
[ 1, 2, 3, 4, 5 ]
1 Output
[ 1, 2, 9, 4, 25 ]
2 Input
[ 2, 4 ]
2 Output
[ 4, 4 ]
"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++];
}
/*not modify above this line */
function main() {
const myArray = JSON.parse(readLine());
/* Write your code here */
Array of String to UpperCase
Sample Input 1
[ 'book', 'table', 'strawberries', 'lemons' ]
Sample Output 1
[ 'BOOK', 'TABLE', 'STRAWBERRIES', 'LEMONS' ]
Sample Input 2
[ 'my best friend', 'florida', 'winter' ]
Sample Output 2
[ 'MY BEST FRIEND', 'FLORIDA', 'WINTER' ]
"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++];
}
/* not modify anything above this line */
String Slicing
Given two strings
inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString. Slice the inputString starting from the subString to the end of the inputString.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)
Sample Input 1
JavaScript
S
Sample Output 1
Script
Sample Input 2
Language
air
Sample Output 2
Language
"use strict";
function readLine() {
return inputString[currentLine++];
}
function main() {
let inputString = readLine();
const subString = readLine();
/* Write your code here */
console.log(subString.substr(inputString.substr(subString)));
}Fare per Kilometer
Given total fare
fare and distance travelled in kilometers distance for a rental bike, write a JS constructor function with a method to calculate the fare per kilometer.
Quick Tip
The formula to calculate the fare per kilometer is,
fare per kilometer = fare / distance
The first line of input contains a number
The output should be a single line containing the fare per kilometer
Update Pickup Point
Given a previous pickup point in the prefilled code, and updated pickup point
Update Pickup Point
Given a previous pickup point in the prefilled code, and updated pickup point
Submarine
Given two numbers
totalTorpedos, torpedosFired as inputs, write a super class Submarine with property and methods as below,PropertyDescriptionisSubmergedIt should contain a boolean value to indicate whether the submarine is submerged or not.....
The sequence of operations is,
Sample Input 1
5
2
Sample Output 1
Submarine Submerged
2 Torpedos Fired, 3 Left
Submarine Surfaced
Sample Input 2
10
2
Sample Output 2
Submarine Submerged
2 Torpedos Fired, 8 Left
Submarine Surfaced
sir plz provide the code for this program
Unite Family
Given three objects
Sample Input 1
{'surname' : 'Jones', 'city': 'Los Angeles'}
{'dish': 'puddings'}
{'pet': 'Peter'}
Sample Output 1
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"
Sample Input 2
{'surname' : 'Williams', 'city': 'Columbia'}
{'dish': 'cakes'}
{'pet': 'Rocky'}
Sample Output 2
Mr and Mrs Williams went to a picnic in Columbia with a boy and a pet Rocky. Mrs Williams made a special dish "cakes"how it is possible these two out puts in console.log
Series of Operations
Given an array
plz provide the code of this program