This commit is contained in:
enforcer007 2022-11-13 12:45:30 +05:30
parent 286159019d
commit 5007ba9f63

View File

@ -10,10 +10,15 @@
// 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_price_of_apples {
fn calculate_price_of_apples(x: i32) -> i32 {
if x > 40 {
x
} else {
2 * x
}
}
// Don't modify this function!
#[test]