You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ---
name: Practice problems unit 2 pathway 1 issue template
about: Issue template for Unit 1 | Pathway 1 | Practice Problems
title: 'Practice problems Unit 2 Pathway 1: Android Basics with Compose'
labels: ''
assignees: ''
URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem
Additional information
Solution suggestions
fun auctionPrice(bid: Bid?, minimumPrice: Int): Int {
return if (bid != null) {
if (bid.amount >= minimumPrice) bid.amount else minimumPrice
} else {
minimumPrice
}
}
or
fun auctionPrice(bid: Bid?, minimumPrice: Int): Int {
return when {
bid == null -> minimumPrice
bid.amount >= minimumPrice -> bid.amount
else -> minimumPrice
}
}
or
fun auctionPrice(bid: Bid?, minimumPrice: Int): Int {
return bid?.amount?.coerceAtLeast(minimumPrice) ?: minimumPrice
}
or
fun auctionPrice(bid: Bid?, minimumPrice: Int): Int {
return bid?.let {
it.amount.coerceAtLeast(minimumPrice)
} ?: minimumPrice
}
The text was updated successfully, but these errors were encountered:
A ---
name: Practice problems unit 2 pathway 1 issue template
about: Issue template for Unit 1 | Pathway 1 | Practice Problems
title: 'Practice problems Unit 2 Pathway 1: Android Basics with Compose'
labels: ''
assignees: ''
URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem
Additional information
Solution suggestions
or
or
or
The text was updated successfully, but these errors were encountered: