STUD.com
← Objectives

Compute · Transform · Analysis & Finance

Compute prorated outside-activity day allowance

A function that takes an appointment fraction, the per-quarter full-time day limit, the off-duty multiplier, and the assumed workday hours, and returns the allowed outside-activity days per quarter, per year, and the equivalent hour budget.

You receive: A pure function activity_budget(appointment_fraction, ft_days_per_quarter, offduty_days_per_week, quarters, workday_hours) -> { days_per_quarter, days_per_year, hours_per_year } graded on hidden numeric cases.

Part of Pitch Investors

What's verified: Verifies the proration formula computes the day and hour budgets consistently from the inputs. Does NOT verify the policy constants (13-day limit, 10-hour workday) apply to the buyer's actual institution or appointment type, and does NOT track or enforce actual consumed days against the budget.

Opens soon

Cost20 credits
AcceptanceAutomated check against your inputs
ProtectionHeld until verified delivery

This objective is verified and ready. It opens soon, once sign-in and payments are live.

Deliverable interface

The exact vocabulary the automated check enforces: keys, tokens, entry points, and worked examples. Generated from the verification source.

{
 "constants": {},
 "entryName": "activity_budget",
 "expectNote": "expect is the comparison-space value (your return value goes through normalize first when one is published)",
 "hiddenCaseCount": 12,
 "hiddenCaseNames": [
  "three_quarter",
  "no_appointment",
  "f_0_9",
  "f_0_1",
  "f_0_6",
  "long_workday",
  "few_quarters",
  "many_days",
  "low_offduty",
  "mid",
  "high_offduty",
  "short_workday"
 ],
 "inputKeys": [
  "appointment_fraction",
  "ft_days_per_quarter",
  "offduty_days_per_week",
  "quarters",
  "workday_hours"
 ],
 "normalizeSource": "def _normalize_activity_budget(r):\n    if not isinstance(r, dict): return repr(r)\n    def n(x, p): return None if x is None else round(float(x), p)\n    return {\"days_per_quarter\": n(r.get(\"days_per_quarter\"), 2), \"days_per_year\": n(r.get(\"days_per_year\"), 2), \"hours_per_year\": n(r.get(\"hours_per_year\"), 2)}\n",
 "returnShapes": [
  [
   "days_per_quarter",
   "days_per_year",
   "hours_per_year"
  ]
 ],
 "signature": "def activity_budget(inp):",
 "submission": "python exposing the entry function; inp is one input object; graded on held-out cases",
 "tier": "calculator",
 "visibleCases": [
  {
   "expect": {
    "days_per_quarter": 13,
    "days_per_year": 52,
    "hours_per_year": 520
   },
   "input": {
    "appointment_fraction": 1,
    "ft_days_per_quarter": 13,
    "offduty_days_per_week": 6,
    "quarters": 4,
    "workday_hours": 10
   },
   "name": "full_time"
  },
  {
   "expect": {
    "days_per_quarter": 45.5,
    "days_per_year": 182,
    "hours_per_year": 1820
   },
   "input": {
    "appointment_fraction": 0.5,
    "ft_days_per_quarter": 13,
    "offduty_days_per_week": 6,
    "quarters": 4,
    "workday_hours": 10
   },
   "name": "half"
  }
 ],
 "vocabulary": [
  "appointment_fraction",
  "days_per_quarter",
  "days_per_year",
  "ft_days_per_quarter",
  "hours_per_year",
  "offduty_days_per_week",
  "quarters",
  "workday_hours"
 ]
}

Get early access to STUD the day it goes live.