TCS PRA 6th September || JAVA/ PYTHON || IEVOLVE ANSWERS
2.68K subscribers
385 photos
1.62K files
124 links
Download Telegram
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution
{
public static void main(String[] args) throws Exception
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
Player[] players = new Player[n];
for(int i = 0; i < n; i++)
{
int id = sc.nextInt();
sc.nextLine();
int matchesPlayed = sc.nextInt();
sc.nextLine();
int totalRuns = sc.nextInt();
sc.nextLine();
String name = sc.nextLine();
String team = sc.nextLine();
players[i] = new Player(id, matchesPlayed, totalRuns, name, team);
}
int input = sc.nextInt();
//sc.nextLine();

Player ans1 = findPlayerWithMinimumMatchesPlayed(players);
if(ans1 != null)
{
System.out.println("id-" + ans1.getId());
System.out.println("matchesPlayed-" + ans1.getMatchesPlayed());
System.out.println("totalRuns-" + ans1.getTotalRuns());
System.out.println("name-" + ans1.getName());
System.out.println("team-" + ans1.getTeam());
}
else
{
System.out.println("No Player found with mentioned attribute");
}

Player ans2 = searchPlayerById(players, input);
if(ans2 != null)
{
System.out.println("id-" + ans2.getId());
System.out.println("matchesPlayed-" + ans2.getMatchesPlayed());
System.out.println("totalRuns-" + ans2.getTotalRuns());
System.out.println("name-" + ans2.getName());
System.out.println("team-" + ans2.getTeam());
}
else
{
System.out.println("No Player found with mentioned attribute");
}
}

public static Player findPlayerWithMinimumMatchesPlayed(Player[] players)
{
int minMatches = 1000;
//Player p = null;
for(int i = 0; i < players.length; i++)
{
if(players[i].getMatchesPlayed() < minMatches)
{
minMatches = players[i].getMatchesPlayed();
//p = players[i];
}
}
for(int i = 0; i < players.length; i++)
{
if(minMatches == players[i].getMatchesPlayed())
{
return players[i];
}
}
return null;

}

public static Player searchPlayerById(Player[] players, int input)
{
for(int i = 0; i < players.length; i++)
{
if(players[i].getId() == input)
{
return players[i];
}
}
return null;
}
}

class Player
{
int id;
int matchesPlayed;
int totalRuns;
String name;
String team;

public Player(int id, int matchesPlayed, int totalRuns, String name, String team)
{
this.id = id;
this.matchesPlayed = matchesPlayed;
this.totalRuns = totalRuns;
this.name = name;
this.team = team;
}

public int getId()
{
return id;
}
public int getMatchesPlayed()
{
return matchesPlayed;
}
public int getTotalRuns()
{
return totalRuns;
}
public String getName()
{
return name;
}
public String getTeam()
{
return team;
}
}


PLAYER MANAGEMENT CODE JAVA 💯💯💯

PRE PRA MAY 27
JAVA 💯💯

https://t.me/tcsprajavapythonitis

https://t.me/tcsprajavapythonitis
echo "Company_Name/Total_Models/Overall_Sales/Revenue"
awk 'BEGIN{FS="/";IGNORECASE=1;c=0}{
if(NR>1){
c=$2*$3
print $1"/"$2"/"$3"/"c;}
}
END{}
'

Best selling cars UNIX CODE

PYTHON PRE PRA 💯

https://t.me/Ievolveanswers

https://t.me/Ievolveanswers
HI TCSer's ❤️

🚨🚨PRA MAY 31st PYTHON / JAVA

Slots Are In Progress🔔🔔

👉 Guaranteed 80+ is our Responsibility

👉 All Mcqs + Unix code + Java/Python code will be provided 💯💯

Book ur slot ASAP and Grab Ur Releasing Letter 🎉 🎉 🎉 🏃🏃🏃

⚠️⚠️Don't waste Your PRA Attempt for paying amount to Recently created channels ⚠️⚠️

❤️We have Acknowledge of 5k followers with 3K+ PRA Cleared Candidates ❤️

👇 For slot booking 👇

@codeboss65
@codeboss65

📌📌 Telegram:
https://t.me/Ievolveanswers
https://t.me/Ievolveanswers

We uploded all PRE PRA CODES and All IEVOLVE COURSE tooScroll up 👆👆👆👆👆👆👆👆👆👆

Scroll up and see the results and reviews of MAY 24th & 26 PRA 🎉🎉🎉🎉💥💥💥💥