ISC Practical 2027: Player Tag Analyzer (Teams and Top Scorer) – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 question: validate player tags of the form NAME-NUMBER, pair players into teams with the same 3-digit number and find the top scorer. Algorithm, documented Java program, verified outputs and exam tips.

This is Question 2 of Sample Paper 1 from the specimen questions CISCE has released for the ISC Year 2027 Computer Science Practical (Paper 2). The concept area is Blended concepts: array + string. Below you will find the question, a plain-language explanation of the logic, an exam-ready algorithm, a fully documented Java program, the real output for every sample input, and tips for scoring the full 15 marks.
Every program on this page was compiled with JDK 21 and run on CISCE’s sample inputs, plus extra boundary inputs of the kind a visiting examiner will try.
The question
A game stores each player's tag and score. Two players form a team when the 3-digit numbers in their tags are the same. A tag has the form NAME-NUMBER (for example, PRO-007). The name contains uppercase letters and the number contains exactly 3 digits.
Design a class PlayerAnalyzer to accept N players (5 ≤ N ≤ 15). If N is outside this range, display INVALID INPUT.
- Check each tag and display "Valid Tag" if it follows the format, or "Invalid Tag" otherwise.
- Find team mates: players with the same 3-digit number form a team. Display teams that have exactly two players, with their combined score. Consider only valid tags. If no pair forms a team, display
NO COMPLETE TEAMS FOUND. - Find the top scorer: among players with valid tags, find the highest score and display the player(s) who achieved it. If there are no valid tags, display
NO VALID TAGS FOUND.
CISCE gives 3 examples with this question. Each one is shown with its output in the Output section below, so you can check your own program against it.
Note on the CISCE sample: CISCE’s Example 2 only shows the team result. A complete program also prints each tag check and the top scorer, as shown in our output.
Understanding the problem
This question blends arrays with string handling. Two parallel arrays hold the data: tag[] and score[], where index i describes the same player in both. A third array, valid[], remembers the result of the format check so that later tasks can skip invalid players.
- Validating the tag: there must be exactly one dash, at least one character before it, only A–Z before it and exactly three digits after it.
indexOf("-")andlastIndexOf("-")together confirm there is a single dash. - Teams: for each valid player i, count the valid players j > i with the same number part. A team is printed only when the count is exactly 2. A group of three is not a "complete team" of two, so it is skipped.
- Top scorer: find the maximum among valid scores first, then print every valid player with that score. This handles ties automatically.

Algorithm [3 marks]
Write the algorithm in the planning session, in numbered steps like these. It must match your program exactly.
- Start.
- Input N. If N < 5 or N > 15, print "INVALID INPUT" and stop.
- Create arrays tag[N], score[N] and valid[N]. Input each tag and score.
- For each i: valid[i] = true if tag[i] has exactly one "-" not at position 0, only uppercase letters before it and exactly 3 digits after it. Print "Valid Tag: " or "Invalid Tag: " with the tag.
- Set found = false. For each valid player i not already grouped: count the valid players j > i whose number part equals that of i, remember the last such j as the partner and mark it as grouped. If the count is exactly 2, print both tags and the sum of their scores, and set found = true.
- If found is false, print "NO COMPLETE TEAMS FOUND."
- If no player is valid, print "NO VALID TAGS FOUND." and stop.
- Find max = the highest score among valid players. Print every valid player whose score equals max.
- Stop.
Java program [7 marks]
The program uses a class with separate methods for each task and comments that explain every data member and the special logic. That is what the 2 documentation marks are for.
import java.util.Scanner;
/**
* ISC Practical 2027 - Sample Paper 1, Question 2
* Validates game tags of the form NAME-NUMBER, finds two-player teams
* (same 3-digit number) and the top scorer among valid tags.
*/
public class PlayerAnalyzer
{
String tag[]; // player tags
int score[]; // player scores
boolean valid[]; // valid[i] is true if tag[i] follows the format
int n; // number of players
PlayerAnalyzer(int num)
{
n = num;
tag = new String[n];
score = new int[n];
valid = new boolean[n];
}
void accept(Scanner sc)
{
for (int i = 0; i < n; i++)
{
System.out.print("Tag and score of player " + (i + 1) + ": ");
tag[i] = sc.next();
score[i] = sc.nextInt();
}
}
// NAME (one or more uppercase letters) + '-' + exactly 3 digits
boolean isValidTag(String t)
{
int dash = t.indexOf('-');
if (dash < 1 || dash != t.lastIndexOf('-')) // exactly one '-', not at the start
return false;
String name = t.substring(0, dash);
String num = t.substring(dash + 1);
if (num.length() != 3)
return false;
for (int i = 0; i < name.length(); i++)
if (name.charAt(i) < 'A' || name.charAt(i) > 'Z')
return false;
for (int i = 0; i < 3; i++)
if (!Character.isDigit(num.charAt(i)))
return false;
return true;
}
// returns the 3-digit number part of a valid tag
String numberPart(String t)
{
return t.substring(t.indexOf('-') + 1);
}
void checkTags()
{
for (int i = 0; i < n; i++)
{
valid[i] = isValidTag(tag[i]);
System.out.println((valid[i] ? "Valid Tag: " : "Invalid Tag: ") + tag[i]);
}
}
// a team is exactly two valid players sharing the same 3-digit number
void findTeams()
{
boolean found = false;
boolean done[] = new boolean[n]; // players already grouped with an earlier player
for (int i = 0; i < n; i++)
{
if (!valid[i] || done[i])
continue;
int count = 1, partner = -1;
for (int j = i + 1; j < n; j++)
{
if (valid[j] && numberPart(tag[j]).equals(numberPart(tag[i])))
{
count++;
partner = j;
done[j] = true;
}
}
if (count == 2) // groups of 3 or more are not complete teams
{
System.out.println("TEAMS : " + tag[i] + ", " + tag[partner]);
System.out.println("Combined Score: " + (score[i] + score[partner]));
found = true;
}
}
if (!found)
System.out.println("TEAMS: NO COMPLETE TEAMS FOUND.");
}
void topScorer()
{
int max = -1;
boolean anyValid = false;
for (int i = 0; i < n; i++)
{
if (valid[i])
{
anyValid = true;
if (score[i] > max)
max = score[i];
}
}
if (!anyValid)
{
System.out.println("NO VALID TAGS FOUND.");
return;
}
for (int i = 0; i < n; i++) // all players who share the highest score
if (valid[i] && score[i] == max)
System.out.println("TOP SCORER: " + tag[i] + " - " + score[i]);
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("N = ");
int n = sc.nextInt();
if (n < 5 || n > 15)
{
System.out.println("INVALID INPUT");
return;
}
PlayerAnalyzer ob = new PlayerAnalyzer(n);
ob.accept(sc);
ob.checkTags();
ob.findTeams();
ob.topScorer();
}
}Variable description
Name Type Purpose
------------- --------- -------
tag[] String[] player tags
score[] int[] player scores (parallel to tag[])
valid[] boolean[] result of the format check for each player
n int number of players
done[] boolean[] players already counted in an earlier group
count int players sharing the current number
partner int index of the team mate
max int highest valid scoreOutput [3 marks]
These are the actual outputs of the program above for every example in the question:
INPUT:
N = 5
PRO-117 850
ACE-112 720
MAX-117 910
ZEN-115 800
BAD-12 950
OUTPUT:
Valid Tag: PRO-117
Valid Tag: ACE-112
Valid Tag: MAX-117
Valid Tag: ZEN-115
Invalid Tag: BAD-12
TEAMS : PRO-117, MAX-117
Combined Score: 1760
TOP SCORER: MAX-117 - 910INPUT:
N = 5
PRO-117 850
MAX-910 910
ACE-115 720
ZEN-120 800
RAY-225 650
OUTPUT:
Valid Tag: PRO-117
Valid Tag: MAX-910
Valid Tag: ACE-115
Valid Tag: ZEN-120
Valid Tag: RAY-225
TEAMS: NO COMPLETE TEAMS FOUND.
TOP SCORER: MAX-910 - 910INPUT:
N = 3
OUTPUT:
INVALID INPUTTest it on unknown inputs
One of the 3 output marks is for correct output on inputs the examiner chooses, usually boundary cases. Our program handles these correctly:
INPUT:
N = 6
PRO-101 700
ACE-101 640
MAX-101 910
ZEN-202 910
RAY-202 500
kid-303 990
OUTPUT:
Valid Tag: PRO-101
Valid Tag: ACE-101
Valid Tag: MAX-101
Valid Tag: ZEN-202
Valid Tag: RAY-202
Invalid Tag: kid-303
TEAMS : ZEN-202, RAY-202
Combined Score: 1410
TOP SCORER: MAX-101 - 910
TOP SCORER: ZEN-202 - 910INPUT:
N = 5
P1-111 10
-222 20
ABC-12A 30
ABC 40
AB-1234 50
OUTPUT:
Invalid Tag: P1-111
Invalid Tag: -222
Invalid Tag: ABC-12A
Invalid Tag: ABC
Invalid Tag: AB-1234
TEAMS: NO COMPLETE TEAMS FOUND.
NO VALID TAGS FOUND.How to score full marks on this question

- Write isValidTag() as a separate boolean method. It makes the algorithm easier to read and earns the "functional behaviour" mark.
- Mention in your documentation that tag[] and score[] are parallel arrays. Examiners look for a clear description of the data.
- Show what happens with three players sharing a number. It proves you read "exactly two players" carefully.
- Keep the typed program identical to the planned one. Large differences between your planning sheet and the printout cost the 2 hard-copy marks.
Common mistakes to avoid
- Accepting lowercase names such as kid-303. The question says the name has uppercase letters only.
- Printing the same team twice (once for i and once for j). The done[] array prevents this.
- Including invalid tags when finding the top scorer. In Example 1, BAD-12 has the highest score (950) but is invalid.
This post is part of our series that solves all 12 specimen questions for the ISC 2027 Computer Science practical, one question a day. Practise writing the algorithm and program on paper in 90 minutes before you type it. That is exactly how the exam works.
Related Posts
Continue learning with these related articles

ISC Practical 2027: Account Number Checksum Verifier – Algorithm and Java Program
Fully solved ISC Computer Science Practical 2027 question: validate a 10-digit account number, apply the double-every-second-digit checksum and find the digital root. Includes the algorithm, a documented Java program, verified outputs and exam tips.

ISC Class 11 Computer Science Evaluation II Sample Paper 2026-27 with Solutions
A full ISC Class 11 Computer Science Evaluation II paper for 2026-27 on Boolean algebra, propositional logic, number systems, the full adder, Java class design and Python, with a checked answer key and complete solutions.

ISC Class 12 Computer Science Evaluation II Sample Paper 2026-27 with Solutions
A full ISC Class 12 Computer Science Evaluation II theory paper for 2026-27 on Boolean algebra, K-maps, encoders, recursion, deque, linked list and binary trees, with a checked answer key, logic diagrams and solved Java programs.