Flattening & case conversion
the given code to get output using array methods flat(),map() and string methods toLowerCase() and toUpperCase().
input
the first line input is an array nestedArray
the second line input is a number depth
output
the output containing an array with words having even lengths in lowercase and odd length in uppercase
input1
['Inspector', ['ANKLE',['HIKE']],'pawn']
output2
['INSPECTOR','ANKLE', 'hike',' pawn']
function readLine() {
return inputString[currentLine++];
}
function main() {
const nestedArray = JSON.parse(readLine().replace(/'/g, '"'));
const depth = JSON.parse(readLine());
/* Please do not modify anything above this line */
// Write your code here
}
words with vowels
the goal of the code is to get output using array method filter()
input
the input will be single line containing an array wordsList
output
the output should be single line containing an array with filtered words
input1
['Sword', 'Myth', 'Patient' ,'Rhythm] output2
['Sword', 'Patient']
"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() {
const wordsList = JSON.parse(readLine().replace(/'/g, '"'));
const vowelsList = ["a", "e", "i", "o", "u"];
// Write your code here
}
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 811 hours and a standard deviation of 95 hours. Find the probability that a random samples of 44 bulbs will have an average life of less than 799 hours.
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 800 hours and a standard deviation of 65 hours. Find the probability that a random samples of 46 bulbs will have an average life of less than 788 hours.
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 808 hours and a standard deviation of 93 hours. Find the probability that a random samples of 19 bulbs will have an average life of greater than 799 hours.
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 810 hours and a standard deviation of 74 hours. Find the probability that a random samples of 36 bulbs will have an average life of greater than 803 hours
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 801 hours and a standard deviation of 98 hours. Find the probability that a random samples of 19 bulbs will have an average life between 782 and 818 hours.
An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed, with mean equal to 777 hours and a standard deviation of 26 hours. Random samples of 30 bulbs are drawn from this population, and the mean of each sample is determined. What is the mean of the mean of the sampling distribution?
The total earnings of a worker are represented by E = 100 + $10(24−L), where E is earnings and L is the number of hours of leisure. How many hours of leisure are consumed if this worker's total earnings are $160? Show solutions.
The total earnings of a worker are represented by E = 100 + $10(24−L), where E is earnings and L is the number of hours of leisure. How much will the worker earn if he takes 14 hours of leisure per day? Show solutions.