THINK FIRST·CODE LATER

← All labs

EU AI Act risk triage (simplified)

Problem

Before building an AI feature, StudyBuddy's team runs a first triage of its EU AI Act risk level (simplified — the result must be confirmed by legal experts).

Input: lines feature: tag1,tag2,... until the end of input. Tags describe what the feature does. Classify each feature by the first matching rule:

  1. PROHIBITED if it has emotion-recognition together with education or workplace (and not medical-or-safety), or has social-scoring, or manipulation-harmful.
  2. HIGH if it has education together with any of admission, grading, learning-steering, level-assessment, exam-proctoring; or it has employment-decision, credit-scoring or biometric-identification.
  3. TRANSPARENCY if it has chatbot, generated-content or emotion-recognition.
  4. MINIMAL otherwise.

Print feature: LEVEL - obligation, with obligation:

  • PROHIBITED → do not deploy in the EU
  • HIGH → risk management, data governance, documentation, logging, human oversight, accuracy, conformity assessment
  • TRANSPARENCY → inform users they interact with AI / label AI content
  • MINIMAL → no specific AI Act obligations

At the end print the counts: Prohibited: a, High: b, Transparency: c, Minimal: d.

Input:

Buddy: education,chatbot,generated-content
AutoGrader: education,grading
EngagementCam: education,emotion-recognition
SpamFilter: moderation

Output:

Buddy: TRANSPARENCY - inform users they interact with AI / label AI content
AutoGrader: HIGH - risk management, data governance, documentation, logging, human oversight, accuracy, conformity assessment
EngagementCam: PROHIBITED - do not deploy in the EU
SpamFilter: MINIMAL - no specific AI Act obligations
Prohibited: 1, High: 1, Transparency: 1, Minimal: 1

Data for this lab

Your program reads its data from standard input. Download the file, then give it to your program as shown below. Start with data set 1: its expected output is given.

s12-4-data-1.txt

Buddy: education,chatbot,generated-content
AutoGrader: education,grading
EngagementCam: education,emotion-recognition
SpamFilter: moderation
What your program must print for s12-4-data-1.txt
Buddy: TRANSPARENCY - inform users they interact with AI / label AI content
AutoGrader: HIGH - risk management, data governance, documentation, logging, human oversight, accuracy, conformity assessment
EngagementCam: PROHIBITED - do not deploy in the EU
SpamFilter: MINIMAL - no specific AI Act obligations
Prohibited: 1, High: 1, Transparency: 1, Minimal: 1

Run your program first, then open this and compare line by line: your output must contain these lines exactly.

How to give the file to my program

Terminal (macOS, Linux, or Windows Command Prompt), after compiling:

java Main < s12-4-data-1.txt

Windows PowerShell does not understand <:

Get-Content s12-4-data-1.txt | java Main

IntelliJ IDEA: Run → Edit Configurations → Redirect input from. Or simply paste the content of the file into the console when the program waits for input.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.