Here in this program "aqString" was not defined please check it again
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.trim().split('\n').map(string => {
return string.trim();
});
main();
});
function readLine() {
return inputString[currentLine++];
}
function main() {
const inputString = readLine();
const subString = readLine();
let index = aqString.find(inputString, subString);
if (isNaN(index) && index <= inputString.length) {
console.log(inputString.split(index));
}
}
Update Pickup Point
Write a Javascript program
Given a previous pickup point in the prefilled code, and updated
pickup point area , city as inputs, write a JS factory function
with a method to update the pickup point.
Input
. The first line of input contains a string area
. The second line of input contains a string city
Output
. The output should be a single line containing the updated pickup
point area and city separated by a space
Sample Input 1
Kukatpally
HyderabadSample Output 1
Kukatpally HyderabadSample Input 2
Jubilee Hills
HyderabadSample Output 2
Jubilee Hills HyderabadAll test cases should be passed
Sample Input 1
true
trueSample Output 1
Grass Trimmed
Garden Cleaned
Watered PlantsSample Input 2
true
falseSample Output 2
Grass Trimmed
Garden Cleaned
Water Hose Pipe Not Foundlet 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 isGrassTrimmerFound = JSON.parse(readLine());
const isWaterHosePipeFound = JSON.parse(readLine());
/* Write your code here */
const myPromise = async () => {
try {
/* Write your code here */
} catch(error) {
/* Write your code here */
}
};
myPromise();
}
I want to pass all test cases
Sample Output 1
Item FoundSample Output 2
Category Not Foundlet 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 categoryOfItem = readLine();
const item = readLine();
const mart = [
{
category:"pulses",
items: ["green gram", "green peas", "Turkish gram"]
},
{
category:"soaps",
items:["santoor", "dove", "lux", "pears"]
},
];
}
In this assignment, let's build a Articles Page by applying the concepts we learned till now. You can use the Bootstrap concepts and CCBP UI Kit as well.
I want pass all test cases
Sample Input 1
8
4Sample Output 1
2
576
1024"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 ArithmeticOperations(firstNumber, secondNumber) {
this.firstNumber = firstNumber;
this.secondNumber = secondNumber;
}
function main() {
const firstNumber = JSON.parse(readLine());
const secondNumber = JSON.parse(readLine());
const operation1 = new ArithmeticOperations(firstNumber, secondNumber);
/* Write your code here */
console.log(operation1.ratioOfNumbers());
console.log(operation1.sumOfCubesOfNumbers());
console.log(operation1.productOfSquaresOfNumbers());
}
I want pass all test cases
Sample Input 1
7Sample Output 1
153.86
43.96Sample Input 2
25Sample Output 2
1962.5
157"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++];
}
/* Please do not modify anything above this line */
function Circle(radius) {
/* Write your code here */
}
/* Please do not modify anything below this line */
function main() {
const radius = JSON.parse(readLine());
const circle1 = new Circle(radius);
console.log(circle1.getArea());
console.log(circle1.getCircumference());
}
I want to pass all test cases
Sample Input 1
Kukatpally
HyderabadSample Output 1
Kukatpally Hyderabad"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++];
}
/* Please do not modify anything above this line */
function createCabBooking(area, city) {
/* Write your code here */
}
/* Please do not modify anything below this line */
function main() {
const newArea = readLine();
const newCity = readLine();
const cabBooking1 = createCabBooking("Abids", "Hyderabad");
cabBooking1.updatePickupPoint(newArea, newCity);
console.log(`${cabBooking1.area} ${cabBooking1.city}`);
}
I want to pass all the test cases
Sample Input 1
1000
2
3Sample Output 1
1060Sample Input 2
2000Sample Output 2
2200"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() {
let input = inputString[currentLine++];
return input === undefined ? undefined : JSON.parse(input);
}
/* Please do not modify anything above this line */
/* Write your code here */
/* Please do not modify anything below this line */
function main() {
const principal = readLine();
const time = readLine();
const apprPercentage = readLine();
const finalValue = calculateFinalValueWithAppreciation(principal, time, apprPercentage);
console.log(finalValue);
}
I want to pass all the test cases
Sample Input 1
200
3Sample Output 1
570Sample Input 2
180
1Sample Output 2
180"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++];
}
/* Please do not modify anything above this line */
function main() {
const dayCharge = JSON.parse(readLine());
const days = parseInt(readLine());
/* Write your code here */
}