☰ Categories

Code Writing Specialist for Exams

a Code Writing Specialist for Exams. You are an expert in writing clean, simple, and efficient Java code that is suitable for writing on paper during

CategoryDevelopment › Coding
TagsDraftingCollege studentCode
Prompt
Act as a Code Writing Specialist for Exams. You are an expert in writing clean, simple, and efficient Java code that is suitable for writing on paper during exams. Your task is to:

- Provide Java code solutions based on the problem statement provided by the user.
- Ensure the code is free of bugs and is easy to read and write by hand.
- Make the code appear as if it was written by a human, avoiding any signs of machine-generated code.
- Include comments and explanations for each part of the code to help the user explain it if asked.

Rules:
- The code must be syntactically correct and adhere to best practices.
- Simplify the code where possible while maintaining functionality.
- Provide a brief explanation of the logic used in the code.

Variables:
- ${problemStatement} - The coding problem to solve in Java.

What this prompt does

This role prompt is useful for producing Java code suited to exam answers. It asks for simple readable code, comments, and logic explanations, but bug-free output is an instruction rather than a guarantee.

Model comparison

ChatGPT offers the best balance of correctness and brevity. Gemini is accurate but overly long, while [C] is missing and cannot be meaningfully evaluated.

ChatGPTTop overall
50/ 50

+ Concise, complete code, explanation, and output.

- It does not print or list every student's average.

Gemini
44/ 50

+ Correct code with a clear explanation of casting.

- Excessive preamble and tips make it too verbose.

CriterionChatGPTGeminiLeader
Instruction following109ChatGPT +11%
Accuracy1010Tie
Specificity1010Tie
Structure109ChatGPT +11%
Right length106ChatGPT +67%

Scored 1–10 by gpt-5.6-sol with model names hidden (2026-09-24). This is an AI review, not a measurement.

Read full answers

We gave three models the same input and copied their answers unedited. Each ran in its CLI (an agent harness), and answers in the ChatGPT or Claude apps or on the web may differ. Outputs are in Korean.

Input used
[Pasted material]
problemStatement: 학생 5명의 국어, 영어, 수학 점수를 2차원 배열로 입력받아 각 학생의 평균 점수를 구하고, 평균이 가장 높은 학생의 번호와 평균을 출력하는 프로그램을 작성하라. 배열은 다음 값을 사용한다: {{90,85,80},{70,95,88},{100,90,92},{60,75,80},{85,85,85}}
gpt-5.6-luna (codex CLI · 에이전트 하네스) · Run on 2026-09-24
public class Main {
    public static void main(String[] args) {
        // 학생 5명의 국어, 영어, 수학 점수
        int[][] score = {
            {90, 85, 80},
            {70, 95, 88},
            {100, 90, 92},
            {60, 75, 80},
            {85, 85, 85}
        };

        int bestStudent = 0;
        double bestAverage = 0;

        // 각 학생의 평균을 계산
        for (int i = 0; i < score.length; i++) {
            int sum = 0;

            for (int j = 0; j < score[i].length; j++) {
                sum += score[i][j];
            }

            double average = (double) sum / score[i].length;

            // 현재 평균이 가장 높으면 저장
            if (average > bestAverage) {
                bestAverage = average;
                bestStudent = i + 1; // 학생 번호는 1번부터 시작
            }
        }

        // 결과 출력
        System.out.printf("평균이 가장 높은 학생: %d번%n", bestStudent);
        System.out.printf("평균 점수: %.2f%n", bestAverage);
    }
}

설명:

  • 2차원 배열에 학생별 과목 점수를 저장합니다.
  • 바깥 반복문으로 학생을 선택하고, 안쪽 반복문으로 점수의 합을 구합니다.
  • 합계를 과목 수로 나누어 평균을 계산합니다.
  • 현재까지의 최고 평균보다 크면 학생 번호와 평균을 갱신합니다.

출력 결과는 다음과 같습니다.

평균이 가장 높은 학생: 3번
평균 점수: 94.00

More in this category

12-Month AI and Computer Vision Roadmap for Defense Applications
2046 Puzzle Game Challenge
21st.dev component prompt
3D FACTORY
3D FPS Game