Created
July 11, 2022 19:17
-
-
Save wajahatkarim3/548dbd287ac296b77ff6af71ec5dc82a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CustomerData { | |
var customerId = “123” | |
var name = “John” | |
var totalBill = 284.34 | |
var purchasedItems: List<Item> = arrayListOf() | |
fun addItem(item: Item) { | |
purchasedItems.add(item) | |
totalBill = calculateBill() | |
} | |
fun calculateBill(): Float { | |
// Some calculations | |
return newBill; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment