re: Daily Challenge #69 - Going to the Cinema VIEW POST

FULL DISCUSSION
 

Here is my try:

function movie(card, ticket,perc){
    let i = 0
    let ticketFullPrice = 0
    let lowedTicket = ticket

    while(card>ticketFullPrice){
        ticketFullPrice += ticket
        lowedTicket *= perc 
        card += lowedTicket 
        i++
    }
    return i
}
movie(500,15,0.9)
movie(100, 10, 0.95)
code of conduct - report abuse