The goal of this coding exam is to quickly get you off the ground with the array method every ()
There is a selecting going on for civil service centre candidates have to participate in a number of events and the candid pose quotes more than 75 points in every event will be selected
Given candidateList as input it contains objects with name of the candidate and array consisting of poet attitude in each given by the candidate
Write a JS program to,
. Filter the candidates who have score more than 75 points in every event.
. Log the consisting of names of the selected candidates in the console
Input:
. The input will be a single line containing an array of objects candidatesList
Constraints
.keys object should be given in quotes
Sample input
[{'name:'blake,'points':[76,98,88,84]},{'name':'james','points':[098,12,33]},]
Output
[Blake]
Write a function solution that given a three digit integer N and Integer K, returns the maximum possible three digit value that can be obtained by performing at most K increases by 1 of any digit in N
Person Details
given an object person containing a person details, write a JS program to log the name, address and nicknames count.
input1
output2
input1
{ 'name':'Pranay', 'address':{'city':'Mumbai','state':'maharastra'}, 'nicknames':['nani','chanti']}
output2
pranay is from mumbai,maharastra
pranay has 2 nicknames
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
//////
/////
/////
function main() {
let person = JSON.parse(readLine().replace(/'/g, '"'));
/* Please do not modify anything above this line */
/* Write your code here and log the output */
}
Magical Indices
Given an array of integers and a number
Write a JS program to determine the number of valid indices.
For example, an array A = [10, 20, 30] and a value x = 25.
We have values 10, 20, 30 at indices 0,1,2 respectively.
So there are 2 valid indices.
Sample Input 1
[1, 2, 3, 5, 7]
13
Sample Output 1
3
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
/////
////
function main() {
let integers = JSON.parse(readLine());
let value = JSON.parse(readLine());
/* Write your code here and log the output */
}
Product of array Items
given an array integers, write JS program to get the product of the integers in the given array.
input
the input will be containing single line integers.
output
the output should be single line containing the product as shown in sample outputs.
input1
[1,2,3]
output1
[1 * 2 * 3 = 6]
input2
[-1, -2, -3]
output2
[-1*-2*-3 = -6]
"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 and log the output */
}
squares of Array items
input
output
input1
[[1,2],[3,4],[5,6]]
output1
[ [ 1,4],[9,16],[25,36]]
input2
[12,[24],36,[48,60]]
output2
[144,[576],1296,[2304,3600]]
"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 myArray = JSON.parse(readLine())
/* Write your code here and log the output */
}
Find the First Value
Given an array myArray of positive integers, write a JS program to find the smallest integer divisible by 2 and 3.
input
the input will be a single line containing an myArray
output
the output should be a single line containing a number divisible by 2 and 3 or undefined.
input1
[51,18,15,12]
output1
12
input2
[41,29,17,19,31]
output2
undefined
"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 myArray = JSON.parse(readLine());
/* Write your code here and log the output */
}
Replacing Array Item
input
output
input1
[1,2,3,"four",5,6]
"four"
4
output1
[1,2,3,4,5,6]
input2
[22,44,88,352,352]
352
176
output2
[22,44,88,176,352]
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
////
/////
function main() {
let myArray = JSON.parse(readLine().replace(/'/g, '"'));
let targetItem = JSON.parse(readLine().replace(/'/g, '"'));
let replaceItem = JSON.parse(readLine().replace(/'/g, '"'));
Write your code here and log the output
}
CCBP Login
Reference image:
https://assets.ccbp.in/frontend/content/dynamic-webapps/ccbp-login-op.gif
<!DOCTYPE html>
<html>
<head> </head>
<body>
<div class="container">
<h1 class="form-heading">CCBP Login</h1>
<form id="myForm">
<div class="username">
<label for="name" class="username-heading">User Name</label>
<input autocomplete="off" type="text" id="name" class="input" />
<p id="nameErrMsg" class="error-message"></p>
</div>
<div class="password">
<label for="password" class="password-heading">Password</label>
<input type="password" id="password" class="input" />
Bike Search
Use the below reference image
https://assets.ccbp.in/frontend/content/dynamic-webapps/bike-search-op.gif
HTML
<!DOCTYPE html>
<html>
<head></head>
<body>
Your code goes here
</body>
</html>
Instructions
Achieve the design with HTML, CSS, and functionality with JS