From 8597b29e143cdeae50eafae06e0d8ed900b25295 Mon Sep 17 00:00:00 2001 From: anand Date: Tue, 18 Nov 2025 22:40:54 +0530 Subject: Completed till exercise 4 --- exercises/quizzes/quiz1.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'exercises/quizzes') diff --git a/exercises/quizzes/quiz1.rs b/exercises/quizzes/quiz1.rs index 04fb2aa..d3a200d 100644 --- a/exercises/quizzes/quiz1.rs +++ b/exercises/quizzes/quiz1.rs @@ -10,7 +10,9 @@ // TODO: Write a function that calculates the price of an order of apples given // the quantity bought. -// fn calculate_price_of_apples(???) -> ??? { ??? } +fn calculate_price_of_apples(apples: i32) -> i32 { + if apples <= 40 { apples * 2 } else { apples } +} fn main() { // You can optionally experiment here. -- cgit v1.2.3