From c1fea5f1c6d36fa529911cba46c8c8d735b9442b Mon Sep 17 00:00:00 2001 From: asif256000 Date: Thu, 22 Dec 2022 13:07:24 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=F0=9F=A6=80=20Quiz=20Solved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exercises/quiz1.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index dbb5cdc9..ac924882 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -10,10 +10,14 @@ // Write a function that calculates the price of an order of apples given // the quantity bought. No hints this time! -// I AM NOT DONE - // Put your function here! -// fn calculate_price_of_apples { +fn calculate_price_of_apples(count: i32) -> i32 { + if count > 40 { + count * 1 + } else { + count * 2 + } +} // Don't modify this function! #[test]