diff options
| author | Brad Clawsie <brad@b7j0c.org> | 2026-11-02 15:31:08 -0600 |
|---|---|---|
| committer | Brad Clawsie <brad@b7j0c.org> | 2026-11-02 15:31:08 -0600 |
| commit | 07cb7e7dfa1b2a520e02af70ee924100127a95be (patch) | |
| tree | 5ec4fc034efe1431c594ca18100caa7cb9a56e97 /ex3_12/src/main.rs | |
| parent | 98fc53dec43f84906f737bb3473bf65c09fc5450 (diff) | |
feat: ex3_12
commit 028ab60ddc9be47264b6aa4c5ceaa592407eee7a
Author: Brad Clawsie <brad@b7j0c.org>
Date: Mon Nov 2 15:30:45 2026 -0600
feat: ex3_12
Diffstat (limited to 'ex3_12/src/main.rs')
| -rw-r--r-- | ex3_12/src/main.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ex3_12/src/main.rs b/ex3_12/src/main.rs new file mode 100644 index 0000000..18effb1 --- /dev/null +++ b/ex3_12/src/main.rs @@ -0,0 +1,14 @@ +mod order; + +use order::Order; + +fn main() { + let mut o = match Order::new("p",1,1) { + Ok(_o) => _o, + Err(e) => panic!("{}", e), + }; + o.set_product_name("p2"); + o.set_quantity(2); + o.set_unit_price(2); + println!("{}{}{}{}", o.product_name(), o.quantity(), o.unit_price(), o.total()); +} |
