
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.
Table of Contents
- Highest Feedback Problem Description:
- Capgemini ADAPT 2022 – Highest Feedback Problem Solution in Java:
- To Stay Up-to-date, Follow us on Social Media:
- ADAPT Different Coding Solutions:
- Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):
- Capgemini ADAPT Sprint 2 (Bus Reservation System):
- Study Materials for Interview Preparation (FREE MATERIALS):
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:
- Largest Array Solution – Click Here
- Batsman & Bowler Solution – Click Here
- Instruments Problem Solution – Click Here
- Check Two Person Are Same – Click Here
- Medicine App ADAPT Solution – Click Here
- String Combination Capgemini ADAPT Solution – Click Here
- Remove”X”inString Problem Solution – Click Here
- Customer and Invoice ADAPT Problem Solution – Click Here
- Book and Author Problem Solution – Click Here
- Highest Feedback Problem Solution – Click Here
Capgemini ADAPT Sprint 1 (Bus Reservation Solutions):
- 1. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerInAscendingOrder Problem Solution
- 2. Capgemini ADAPT Sprint 1 Bus Reservation System – DisplayCustomerByFirstName Problem Solution
- 3. Capgemini ADAPT Sprint 1 Bus Reservation System – SortByCustomerId Problem Solution
- 4. Capgemini ADAPT Sprint 1 Solution Java | LSAByCustomerName Problem Solution
- 5. Capgemini ADAPT Sprint 1 Case Study Solution Java | BSAByCustomerId Problem Solution
Capgemini ADAPT Sprint 2 (Bus Reservation System):
- 1. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution | HAS-A-Relationship Solution Java
- 2. Capgemini ADAPT Sprint 2 Case Study (Bus Reservation System) Solution OOPs-Para-Constructor Java
- 3. Capgemini ADAPT Sprint 2 Bus Reservation System (CRUDOperations) Problem Solution
Study Materials for Interview Preparation (FREE MATERIALS):
- 240 Core Java Questions & Answers with PDF Download Link – Click Here
- 230+ SQL interview questions & answers pdf download – Click Here
- 50 LeetCode Interview Questions with Answers – PDF Notes – Click Here