Skip to content

Implement static loadTriangle method to read triangle data from file #452

Description

@avery-jingxin

Description

We need to implement a static method loadTriangle(String path) in the NumberTriangle class that loads triangle data from a file.

Requirements

  • Read triangle data from the specified file path
  • Parse the file contents and create a NumberTriangle object
  • Handle invalid file paths with appropriate error handling
  • Support the expected file format for triangle data

Expected Behavior

The method should:

  1. Take a file path as a String parameter
  2. Read and parse the file contents
  3. Return a properly initialized NumberTriangle object
  4. Throw appropriate exceptions for invalid inputs or file errors

Acceptance Criteria

  • Method signature matches specification
  • File reading implemented correctly
  • Error handling for invalid files
  • Unit tests added and passing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions