Add quiz1 solution

This commit is contained in:
David Bailey 2021-01-16 20:37:46 +00:00
parent d9824aead2
commit 01f7d29148

View file

@ -7,10 +7,14 @@
// more than 40 at once, each apple only costs 1! Write a function that calculates
// the price of an order of apples given the order amount. No hints this time!
// I AM NOT DONE
// Put your function here!
// fn ..... {
fn calculate_apple_price(amount: i32) -> i32 {
if amount > 40 {
amount
} else {
amount * 2
}
}
// Don't modify this function!
#[test]