CAPGEMINI, ACCENTURE & COGNIZANT EXAM SOLUTION GROUP:
@Coding_human
@Coding_human
@Coding_human
https://t.me/capgemini_accenture_code
https://t.me/DMAD_Discussion
https://t.me/capgemini_accenture_code
✅ Share post in ur college Whatsapp grps.
@Coding_human
@Coding_human
@Coding_human
https://t.me/capgemini_accenture_code
https://t.me/DMAD_Discussion
https://t.me/capgemini_accenture_code
✅ Share post in ur college Whatsapp grps.
Nick's check Solutions
class AreConsecutive
{
/* The function checks if the array elements are consecutive
If elements are consecutive, then returns true, else returns
false */
boolean areConsecutive(int arr[], int n)
{
if (n < 1)
return false;
/* 1) Get the minimum element in array */
int min = getMin(arr, n);
/* 2) Get the maximum element in array */
int max = getMax(arr, n);
/* 3) max - min + 1 is equal to n, then only check all elements */
if (max - min + 1 == n)
{
/* Create a temp array to hold visited flag of all elements.
Note that, calloc is used here so that all values are initialized
as false */
boolean visited[] = new boolean[n];
int i;
for (i = 0; i < n; i++)
{
/* If we see an element again, then return false */
if (visited[arr[i] - min] != false)
return false;
/* If visited first time, then mark the element as visited */
visited[arr[i] - min] = true;
}
/* If all elements occur once, then return true */
return true;
}
return false; // if (max - min + 1 != n)
}
/* UTILITY FUNCTIONS */
int getMin(int arr[], int n)
{
int min = arr[0];
for (int i = 1; i < n; i++)
{
if (arr[i] < min)
min = arr[i];
}
return min;
}
int getMax(int arr[], int n)
{
int max = arr[0];
for (int i = 1; i < n; i++)
{
if (arr[i] > max)
max = arr[i];
}
return max;
}
/* Driver program to test above functions */
public static void main(String[] args)
{
AreConsecutive consecutive = new AreConsecutive();
int arr[] = {5, 4, 2, 3, 1, 6};
int n = arr.length;
if (consecutive.areConsecutive(arr, n) == true)
System.out.println("Array elements are consecutive");
else
System.out.println("Array elements are not consecutive");
}
}
Oops concepts
import java.util.Arrays;
public class IntegerList {
private int[] list;
private int elementIndex = 0;
public IntegerList(int size) {
IntegerList list = new IntegerList(size);
}
public void add(int value) {
for(int i=0;i<list.length;i++) {
try{
list[i] = value;
}
catch (Exception e) {
System.out.println("Can't add, list is full");
}
}
}
public String toString() {
for(int i=0;i<list.length;i++) {
return i+ " : "+ list[i];
}
}
}
Integer arry
import java.util.Arrays;
public class IntegerList {
private int[] list;
private int elementIndex = 0;
public IntegerList(int size) {
IntegerList list = new IntegerList(size);
}
public void add(int value) {
for(int i=0;i<list.length;i++) {
try{
list[i] = value;
}
catch (Exception e) {
System.out.println("Can't add, list is full");
}
}
}
Magic ball
import java.util.*;
public class Solution{
public static void main(String args[]) throws Exception{https://t.me/Coding_human
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
while(test-->0){
int ans = 0;
int num_of_coins = sc.nextInt();
try{
if(num_of_coins<0)
throw new Exception("Enter the valid number of coins");
}
catch(Exception e){
System.out.print(e);
}
for(int i =1; i<=num_of_coins;i++){
ans+=(int) Math.pow(i,2);
}
System.out.print(ans);
}
}
}
public String toString() {
for(int i=0;i<list.length;i++) {
return i+ " : "+ list[i];
}
}
}
Nick's check Solutions
Accenture Exam
Telegram
https://t.me/Coding_human
https://t.me/Coding_human
class AreConsecutive
{
/* The function checks if the array elements are consecutive
If elements are consecutive, then returns true, else returns
false */
boolean areConsecutive(int arr[], int n)
{
if (n < 1)
return false;
/* 1) Get the minimum element in array */
int min = getMin(arr, n);
/* 2) Get the maximum element in array */
int max = getMax(arr, n);
/* 3) max - min + 1 is equal to n, then only check all elements */
if (max - min + 1 == n)
{
/* Create a temp array to hold visited flag of all elements.
Note that, calloc is used here so that all values are initialized
as false */
boolean visited[] = new boolean[n];
int i;
for (i = 0; i < n; i++)
{
/* If we see an element again, then return false */
if (visited[arr[i] - min] != false)
return false;
/* If visited first time, then mark the element as visited */
visited[arr[i] - min] = true;
}
/* If all elements occur once, then return true */
return true;
}
return false; // if (max - min + 1 != n)
}
/* UTILITY FUNCTIONS */
int getMin(int arr[], int n)
{
int min = arr[0];
for (int i = 1; i < n; i++)
{
if (arr[i] < min)
min = arr[i];
}
return min;
}
int getMax(int arr[], int n)
{
int max = arr[0];
for (int i = 1; i < n; i++)
{
if (arr[i] > max)
max = arr[i];
}
return max;
}
/* Driver program to test above functions */
public static void main(String[] args)
{
AreConsecutive consecutive = new AreConsecutive();
int arr[] = {5, 4, 2, 3, 1, 6};
int n = arr.length;
if (consecutive.areConsecutive(arr, n) == true)
System.out.println("Array elements are consecutive");
else
System.out.println("Array elements are not consecutive");
}
}
Oops concepts
import java.util.Arrays;
public class IntegerList {
private int[] list;
private int elementIndex = 0;
public IntegerList(int size) {
IntegerList list = new IntegerList(size);
}
public void add(int value) {
for(int i=0;i<list.length;i++) {
try{
list[i] = value;
}
catch (Exception e) {
System.out.println("Can't add, list is full");
}
}
}
public String toString() {
for(int i=0;i<list.length;i++) {
return i+ " : "+ list[i];
}
}
}
Integer arry
import java.util.Arrays;
public class IntegerList {
private int[] list;
private int elementIndex = 0;
public IntegerList(int size) {
IntegerList list = new IntegerList(size);
}
public void add(int value) {
for(int i=0;i<list.length;i++) {
try{
list[i] = value;
}
catch (Exception e) {
System.out.println("Can't add, list is full");
}
}
}
Magic ball
import java.util.*;
public class Solution{
public static void main(String args[]) throws Exception{https://t.me/Coding_human
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
while(test-->0){
int ans = 0;
int num_of_coins = sc.nextInt();
try{
if(num_of_coins<0)
throw new Exception("Enter the valid number of coins");
}
catch(Exception e){
System.out.print(e);
}
for(int i =1; i<=num_of_coins;i++){
ans+=(int) Math.pow(i,2);
}
System.out.print(ans);
}
}
}
public String toString() {
for(int i=0;i<list.length;i++) {
return i+ " : "+ list[i];
}
}
}
Nick's check Solutions
Accenture Exam
Telegram
https://t.me/Coding_human
https://t.me/Coding_human
You cannot be a master in all technologies. Master a couple and be the expert on your team or in your organization
Telegram: https://t.me/Coding_human
Telegram: https://t.me/Coding_human
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
n=int(input())
if n%5==0:
print(-1)https://t.me/Coding_human
else:
print(n%5)n=int(input())
if n%5==0:
print(-1)
else:
print(n%5)
Python
Telegram👇
https://t.me/Coding_human
https://t.me/Coding_human
https://t.me/Coding_human
⚠️ Share post in ur college and telegram Group's
if n%5==0:
print(-1)https://t.me/Coding_human
else:
print(n%5)n=int(input())
if n%5==0:
print(-1)
else:
print(n%5)
Python
Telegram👇
https://t.me/Coding_human
https://t.me/Coding_human
https://t.me/Coding_human
⚠️ Share post in ur college and telegram Group's
n=int(input())
if n%5==0:
print(-1)https://t.me/Coding_human
else:
print(n%5)n=int(input())
if n%5==0:
print(-1)
else:
print(n%5)
Python
Telegram👇
https://t.me/Coding_human
https://t.me/Coding_human
https://t.me/Coding_human
⚠️ Share post in ur college and telegram Group's
if n%5==0:
print(-1)https://t.me/Coding_human
else:
print(n%5)n=int(input())
if n%5==0:
print(-1)
else:
print(n%5)
Python
Telegram👇
https://t.me/Coding_human
https://t.me/Coding_human
https://t.me/Coding_human
⚠️ Share post in ur college and telegram Group's
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
CAPGEMINI, ACCENTURE & COGNIZANT EXAM SOLUTION GROUP:
@Coding_human
@Coding_human
@Coding_human
https://t.me/capgemini_accenture_code
https://t.me/DMAD_Discussion
https://t.me/capgemini_accenture_code
✅ Share post in ur college Whatsapp grps.
@Coding_human
@Coding_human
@Coding_human
https://t.me/capgemini_accenture_code
https://t.me/DMAD_Discussion
https://t.me/capgemini_accenture_code
✅ Share post in ur college Whatsapp grps.
Tcs answers
1) 510
2) A,B, C and D
3) 109.5
4) 2.5
5- 11.11%
7.8400
8.420
9.59
10.)69
Telegram - https://t.me/Coding_human
1) 510
2) A,B, C and D
3) 109.5
4) 2.5
5- 11.11%
7.8400
8.420
9.59
10.)69
Telegram - https://t.me/Coding_human
Reasoning
1)T
2)B
3)A(Both a and R true)
4)4116
5)D(Contact to vice chancellor)
6)NWH
7)1
8)63
9)C
10)D
11)C
12)0.317:8.51
13)He would not be promoted
14)A
15)A(only assumption 1 is implicit) https://t.me/Coding_human
16)30
17) Pollution
18)(27,125,326)
19)A
20)Tjcs.
21)Father
22)B
23)only assumption 2 is implicit
24)A
Tg : https://t.me/Coding_human
1)T
2)B
3)A(Both a and R true)
4)4116
5)D(Contact to vice chancellor)
6)NWH
7)1
8)63
9)C
10)D
11)C
12)0.317:8.51
13)He would not be promoted
14)A
15)A(only assumption 1 is implicit) https://t.me/Coding_human
16)30
17) Pollution
18)(27,125,326)
19)A
20)Tjcs.
21)Father
22)B
23)only assumption 2 is implicit
24)A
Tg : https://t.me/Coding_human
Psuedo codes:
1) error
2)else must come after if
3)boolen https://t.me/Coding_human
4)if the function does not have any arguments
5)A static methd can over ridden
6)it is manufactured like......
7)it is more code focused and less documents
8)2.000000,3.000000
9)b val=1
10)b val=30
Telegram https://t.me/Coding_human
1) error
2)else must come after if
3)boolen https://t.me/Coding_human
4)if the function does not have any arguments
5)A static methd can over ridden
6)it is manufactured like......
7)it is more code focused and less documents
8)2.000000,3.000000
9)b val=1
10)b val=30
Telegram https://t.me/Coding_human
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM