From fca2d54cb80e7f3b1cc9c7eac5fdbaab191b91b1 Mon Sep 17 00:00:00 2001 From: Suzie Kim Date: Wed, 31 Jan 2024 11:15:37 -0500 Subject: [PATCH] Complete Quiz 1 --- exercises/quiz1.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index 4ee5ada7..b47d8ada 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -13,10 +13,11 @@ // // No hints this time ;) -// I AM NOT DONE // Put your function here! -// fn calculate_price_of_apples { +fn calculate_price_of_apples(quantity: i32) -> i32 { + if quantity > 40 { quantity } else { quantity * 2 } +} // Don't modify this function! #[test]