From 4823839cbd7f2ded1ce9839e1f9ee514b0fce520 Mon Sep 17 00:00:00 2001 From: blacktoast Date: Tue, 5 Oct 2021 19:59:55 +0900 Subject: [PATCH] testy --- exercises/quiz1.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index b13b9284..79aa8fc8 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -7,7 +7,6 @@ // more than 40 at once, each apple only costs 1! 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_apple_price { @@ -23,3 +22,11 @@ fn verify_test() { assert_eq!(80, price2); assert_eq!(65, price3); } + + +fn calculate_apple_price(price:i32) -> i32 { + if price>40{ + price + } + else {price*2} +} \ No newline at end of file