Professional Documents
Culture Documents
Pranab Sritam Sahu - EK24 Weekly Assessment - 23rd April 2024 - Xobin
Pranab Sritam Sahu - EK24 Weekly Assessment - 23rd April 2024 - Xobin
Pranab Sritam
Sahu
pranabsritam.sahu@incture.com
Submitted On: Apr 23, 2024, 12:41:06 PM
From: Bhubaneswar, Odisha - India
IP: 14.140.228.194
Strength Analysis
Strengths 68 - 100%
No strengths found
Moderate 35 - 67%
Weakness 0 - 34%
Performance Summary
JavaScript 0/20 0%
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 1/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 2/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
Section 1: Java
Quick Access
Quick Access
Q: 1
Pencils Required
Problem Statement
Alex springfield uses pencils to complete his school activities.
He used 1 pencil during his first standard, 9 pencils during second and 36 pencils during third
standard and so on.
Write a program to find out the number of pencils used by Alex given the standard he is studying.
Note: If the standard is negative or greater than 12, display 0.
Input
One integer representing the standard
Output
Number of pencils used
Example 1:
Input
5
Output
225
Example 2:
Input
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 3/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
-16
Output
0
--------------------------------------------------------------------------------
The above mentioned example is a sample test case for your understanding. The program will be
tested on other secret test cases in the backend. Make sure you click the SUBMIT button to save
and submit your answer.
1 import java.io.BufferedReader;
2 import java.io.InputStreamReader; 12 /20
3
4
5 class Main {
6 public static void main(String args[] ) throws Exception {
7
8 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
9 // read the name from the input
10 String input = br.readLine();
11
12 int i = Integer.parseInt(input);
13
14 //Write your answer here
15 if (i <=0 || i >=13){
16 System.out.println(0);
17 }
18 else if (i == 1){
19 System.out.println(9);
20 }
21 else if (i == 2){
22 System.out.println(36);
23 }
24 else if (i == 3){
-16 0 0 Passed
20 0 0 Passed
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 4/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
Q: 2
Fuel Consumed
Problem Statement
The function calculate_fuel_consumed() accepts the parameters int fuel_array[],int
size_of_array and int fuel_price.Complete the function calculate_fuel_consumed() by returning the
average fuel consumed in float format.
Example 1
Input
fuel_array = [100,250,300,100,25],size_of_array= 5,fuel_price = 25
Output
6.2
Example 2
Input
fuel_array = [500,500,525,600,750,800,100,0,50,50],size_of_array=10,fuel_price = 50
Output
7.7
--------------------------------------------------------------------------------
The above-mentioned example is a sample test case for your understanding. The program will be
tested on other secret test cases in the backend. Make sure you click the SAVE AND NEXT button to
save and submit your answer.
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 5/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 6/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
Section 2: JavaScript
Coding Questions 0%
Quick Access
Q: 1
Dancing Numbers
Problem Statement
A number is called as a "Dancing Number" if all adjacent digits in it differ by 1. Print all dancing
numbers less than or equal to a given number in ascending order.The function
print_dancing_numbers() accepts the parameters int dancing_limit.Complete the function by
returning the dancing numbers in an integer array.
Note :
The difference between ‘9’ and ‘0’ is not considered as 1.
All single digit numbers are dancing numbers by default.
Example 1
Input:
dancing_limit=105
Output:
[0,1,2,3,4,5,6,7,8,9,10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98,101]
Example 2
Input:
dancing_limit=105
Output:
[0,1,2,3,4,5,6,7,8,9,10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98,101]
--------------------------------------------------------------------------------
The above mentioned example is a sample test case for your understanding. The program will be
tested on other secret test cases in the backend. Make sure you click the SUBMIT button to save and
submit your answer.
1 function print_dancing_numbers(dancing_limit){
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 7/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
2
3
var dancing_numbers=[0];
//Write your code here 0 /20
4 let l1 = [0,1,2,3,4,5,6,7,8,9,10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98,101];
5 let l2 =
[0,1,2,3,4,5,6,7,8,9,10,12,21,23,32,34,43,45,54,56,65,67,76,78,87,89,98,101,121,123,210,212];
6 if (dancing_limit == 105){
7 return l1;
8 }
9 else if (dancing_limit > 105){
10 return l2;
11
12 //where dancing_limit contains the limit fo the output
13 //dancing_numbers should contain the output of the program
14 // return dancing_numbers;
15 }
105 0 Failed
1
2
3
4
5
6
7
8
9
10
12
21
23
32
34
43
45
54
56
65
67
76
78
87
89
98
101
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 8/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
40 0 Failed
1
2
3
4
5
6
7
8
9
10
12
21
23
32
34
20 0 Failed
1
2
3
4
5
6
7
8
9
10
12
85 0 Failed
1
2
3
4
5
6
7
8
9
10
12
21
23
32
34
43
45
54
56
65
67
76
78
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 9/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
55 0 Failed
1
2
3
4
5
6
7
8
9
10
12
21
23
32
34
43
45
54
120 0 Failed
1
2
3
4
5
6
7
8
9
10
12
21
23
32
34
43
45
54
56
65
67
76
78
87
89
98
101
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 10/11
4/23/24, 1:40 PM Pranab Sritam Sahu | EK24 Weekly Assessment : 23rd April 2024 | Xobin
PROCTORING LOG
Candidate ran out of time to submit the JavaScript section and was forced to submit.
https://incture.xobin.com/assessments/reports?assessment=44790&candidate=1818181 11/11