finish quiz1

This commit is contained in:
NoneTheWisr 2022-01-28 18:31:23 +04:00
parent df11d5b28a
commit 1ed08d9808

View File

@ -8,10 +8,11 @@
// 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 {
fn calculate_apple_price(quantity: u32) -> u32 {
let price = if quantity > 40 { 1 } else {2};
price * quantity
}
// Don't modify this function!
#[test]