Previous Next
0 / 15
Module DEMO-33-71DEMO-OOP-33

Student Batch Formatter

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a helper class that builds a student badge using string methods and prints the grade letter.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. first name
  2. last name
  3. student id
  4. mark

Output Format

Print the exact report in this order:

  1. Badge
  2. Letter

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
Lina
Saleh
12
95
Badge: LS-12
Letter: A
Input: first name = "Lina", last name = "Saleh", student id = 12, mark = 95.
Key calculation(s): badge = "Lina".substring(0, 1).toUpperCase() + "Saleh".substring(0, 1).toUpperCase() + "-" + 12 | letter = 95 >= 90 ? "A" : (95 >= 80 ? "B" : (95 >= 70 ? "C" : "D")) | "Badge: " + badge = "Badge: LS-12".
Output:
Badge: LS-12
Letter: A
Sample #2
Public sample
Omar
Ali
41
82
Badge: OA-41
Letter: B
Input: first name = "Omar", last name = "Ali", student id = 41, mark = 82.
Key calculation(s): badge = "Omar".substring(0, 1).toUpperCase() + "Ali".substring(0, 1).toUpperCase() + "-" + 41 | letter = 82 >= 90 ? "A" : (82 >= 80 ? "B" : (82 >= 70 ? "C" : "D")) | "Badge: " + badge = "Badge: OA-41".
Output:
Badge: OA-41
Letter: B

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings