Skip to content

ksherbondy/calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RUST PROJECT: TERMINAL ARITHMETIC UTILITY

Status

Phase: Initial Design & Control Flow Diagramming (Chapter 6 Focus) Objective: Create a highly robust, error-handling calculator demonstrating Rust's core safety features.

Engineering Mandate

This project is built under a 'Mission-Critical Standard' to achieve:

  1. Guaranteed Safety: Eliminate all possible runtime panics via explicit error handling.
  2. Structural Integrity (SRP): Decompose the application into single-responsibility units (I/O, Parsing, Calculation).
  3. Type Enforcement: Use Enums and Match statements to replace verbose conditional logic and enforce type integrity.

Core Learning & Concept Validation

This program demonstrates mastery of the following fundamental Rust principles:

  • Data Flow: Correct use of Borrowing (&mut) to reuse a single input buffer efficiently, preventing memory churn.
  • Control Flow: Using Enums and the match expression to manage application state and operation selection.
  • Structs/Methods: Grouping data and behavior using structs and impl methods.
  • Error Handling: Utilizing the Result type and custom error messages (Chapter 9 preview) to avoid the use of expect() or panic!().

Data Structure Design

The core operation will be modeled by an Enum to enforce mutual exclusivity:

  • enum Operation { Add(f64, f64), Subtract(f64, f64), ... }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages