solved ex.quiz1
This commit is contained in:
parent
e19663cec8
commit
e73b046fe5
|
@ -7,10 +7,15 @@
|
|||
// 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(num:i32) -> i32 {
|
||||
if num < 40 {
|
||||
num * 2
|
||||
} else {
|
||||
num
|
||||
}
|
||||
}
|
||||
|
||||
// Don't modify this function!
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue