Original exercises

This commit is contained in:
Nidhal Messaoudi
2023-02-27 21:33:28 +01:00
parent 1acbbb6d43
commit 278a1f103b
27 changed files with 87 additions and 58 deletions

View File

@@ -10,20 +10,10 @@
// Write a function that calculates the price of an order of apples given
// the quantity bought. No hints this time!
// Put your function here!
fn calculate_price_of_apples(quantity: i32) -> i32 {
let mut quantity= quantity;
if quantity <= 40 {
quantity = quantity * 2;
}
return quantity;
// I AM NOT DONE
// if quantity > 40 {
// quantity
// } else {
// quantity * 2
// }
}
// Put your function here!
// fn calculate_price_of_apples {
// Don't modify this function!
#[test]