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

Name Archive Sort

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create a helper class that stores names in an ArrayList, sorts them, and prints the sorted report.

Input Format

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

  1. first name
  2. second name
  3. third name

Output Format

Print the exact report in this order:

  1. First
  2. Last
  3. Joined

Sample Testcases

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

Sample #1
Public sample
Lina
Omar
Dana
First: Dana
Last: Omar
Joined: Dana:Lina:Omar
Input: first name = "Lina", second name = "Omar", third name = "Dana".
Key calculation(s): names = new ArrayList<>() | names.add("Lina") | "First: " + names.get(0) = "First: Dana".
Output:
First: Dana
Last: Omar
Joined: Dana:Lina:Omar
Sample #2
Public sample
Bashar
Amal
Zaid
First: Amal
Last: Zaid
Joined: Amal:Bashar:Zaid
Input: first name = "Bashar", second name = "Amal", third name = "Zaid".
Key calculation(s): names = new ArrayList<>() | names.add("Bashar") | "First: " + names.get(0) = "First: Amal".
Output:
First: Amal
Last: Zaid
Joined: Amal:Bashar:Zaid

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