Rust let, mut, and shadowing

F-SHADOW-V4-2medium

Weigh without the ice

A fish-market dispatch command prepares crate weight slips and a fixed-price crate bill. Fresh crates include the standard ice allowance; the day’s selected fish kind receives the special crate price.

What needs to change

Repair net so the weight slip receives net grams for a fresh crate and the unchanged grams for dried fish.

Reproduce

  1. Compile with rustc, run the sample crates and compare each weight with the expected stdout.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

The file contains its imports, read_lines, parse and the complete main.

Input: one "fish grams" pair per line; dried fish names start with dried. A fresh crate includes 300 g of ice, so its gross weight is at least 300 g.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in