Highest Feedback Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java
Highest Feedback Problem Solution in Java | Capgemini ADAPT 2022 Solution using Java

In this post, you will get the solution to the Capgemini ADAPT 2022 solution to the problem of Highest Feedback in Java. Capgemini ADAPT Java Solutions 2022, Highest Feedback.

Note: The solutions are provided for learning purposes only. 

Highest Feedback Problem Description:


In a company, there are some managers working on two different projects(MetLife and Hardfort). When the feedback was taken their feedback was present in both MetLife Feedback as well as Hardfort Feedback. Write a method to create consolidated feedback for the managers for MetLife and HardForts. For those working on both projects, the highest feedback is taken. In the 2 given arrays, the First index represents the Employee id and the second one Represents the Feed BAck Score, and so on…

Input and Output Format (Highest Feedback):


First-line corresponds to n, the size of the array. The next n lines correspond to the elements of the first array. The next n lines correspond to the elements in the second array. The output corresponds to the consolidated feedback score.

Capgemini ADAPT 2022 – Highest Feedback Problem Solution in Java:


import java.util.Scanner;
public class Source
{
public static void main(String[] args)
{
int n, i,j,k=0,count,count1;
Scanner in=new Scanner(System.in);
n = in.nextInt();
if(n < 0)
{
System.out.print(“Invalid array size”);
System.exit(0);
}
else
{
int a[]=new int[n];
for(i = 0; i< n; i++)
{
a[i] = in.nextInt();
if(a[i] < 0)
{
System.out.print(“Invalid input”);
System.exit(0);
}
}
int b[]=new int[n];
for(i = 0; i< n; i++)
{
b[i] = in.nextInt();
if(b[i] < 0)
{
System.out.print(“Invalid input”);
System.exit(0);
}
}
int c[]=new int[100];
for(i=0;i<n;i=i+2)
{
count=0;
for(j=0;j<n;j=j+2)
{
if(a[i]==b[j])
{
count=1;
if(a[i+1]>b[j+1])
{
c[k]=a[i];
c[++k]=a[i+1];
k++;
}
else
{
c[k]=a[i];
c[++k]=b[j+1];
k++;
}
}
}
if(count==0)
{
c[k]=a[i];
c[++k]=a[i+1];
k++;
}
}
for(i=0;i<n;i=i+2)
{
count1=0;
for(j=0;j<n;j=j+2)
{
if(b[i]==a[j])
{
count1=1;
}
}
if(count1!=1)
{
c[k]=b[i];
c[++k]=b[i+1];
k++;
}
}
for(i=0;i<k;i++)
{
System.out.println(c[i]);
}
}
}
}

TOP COMPANIES HIRING DRIVE

BATCHWISE OFF-CAMPUS DRIVES

1. TCS OFF-CAMPUS DRIVES 1. 2018 BATCH
2. INFOSYS OFF-CAMPUS DRIVES 2. 2019 BATCH
3. COGNIZANT OFF-CAMPUS DRIVES 3. 2020 BATCH
4. WIPRO OFF-CAMPUS DRIVES 4. 2021 BATCH
5. CAPGEMINI OFF-CAMPUS DRIVES 5. 2022 BATCH

 

To Stay Up-to-date, Follow us on Social Media:


1.      Join our Telegram Channel:

Click Here

2.      Like us on Facebook:

Click Here

3.      Follow us on Instagram:

Click Here

4.      Follow us on LinkedIn:

Click Here

5.      Follow us on Google News:

Click Here

 

ADAPT Different Coding Solutions:


  1. Largest Array Solution – Click Here
  2. Batsman & Bowler Solution – Click Here
  3. Instruments Problem Solution – Click Here
  4. Check Two Person Are Same – Click Here
  5. Medicine App ADAPT Solution – Click Here
  6. String Combination Capgemini ADAPT Solution – Click Here
  7. Remove”X”inString Problem Solution – Click Here
  8. Customer and Invoice ADAPT Problem Solution – Click Here
  9. Book and Author Problem Solution – Click Here
  10. Highest Feedback Problem Solution – Click Here

Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):


Capgemini ADAPT Sprint 2 (Bus Reservation System):


Study Materials for Interview Preparation (FREE MATERIALS):


  1. 240 Core Java Questions & Answers with PDF Download Link – Click Here
  2. 230+ SQL interview questions & answers pdf download – Click Here
  3. 50 LeetCode Interview Questions with Answers – PDF Notes – Click Here