Skip to content

Instantly share code, notes, and snippets.

@wajahatkarim3
Created July 11, 2022 19:17
Show Gist options
  • Save wajahatkarim3/548dbd287ac296b77ff6af71ec5dc82a to your computer and use it in GitHub Desktop.
Save wajahatkarim3/548dbd287ac296b77ff6af71ec5dc82a to your computer and use it in GitHub Desktop.
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