faisal almasloukhi

 avatar
unknown
plain_text
3 years ago
1.3 kB
3
Indexable
fun main(args : Array<String>) {

    var carType= arrayListOf<String>()
    var year = arrayListOf<Int>()
    var price = arrayListOf<Double>()
    var killo = arrayListOf<Double>()
    var a = 1
    var b=1
    var sum = 0
    var discount = 0

    while ( a != 0) {

        println("if you want to exit enter 0 \n ")

        println(" Enter the car type: ")
        var car = readLine()!!.toString()
        carType.add(car)

        println("Enter the car year : ")
        var carYear= readLine()!!.toInt()
        year.add(carYear)

        println("Enter the car price: ")
        var carPrice= readLine()!!.toDouble()
        car+=carPrice

        println("Enter the car killo meters: ")
        var killoMeters= readLine()!!.toDouble()
        killo.add(killoMeters)
    }
    


    while ( b != 0 ) {

        println("if you have a discount please enter it : ")
        var disc = readLine()!!
        disc+=discount

   }


    println("car price before the discount $carType $price \n after the discount $carType $discount")
    println("car name is :  $carType \n and it's price $price ")
    println ("total of prices : $sum ")
    println("car name is $carType \n and it's year $year  ")
    println("car name is $carType \n and it's killo  $killo  ")



}
Editor is loading...