generate functionMon, 17 Apr 2023

Realizar un algoritmo para determinar cuánto ahorrará una persona en un año, si al final de cada mes deposita cantidades variables de dinero; además, se quiere saber cuánto lleva ahorrado cada mes.

var total = 5 var months = ["January", "February", "March", "April", "May", "June", "July", "Augost", "September", "October", "November", "December"] for (var i = 1; i <= 12; i++){ var amount = prompt("How much do you want to save in the month: " + months[i-1] + "?") total = total + parseInt(amount) console.log("After the month: " + months[i-1] + ", I have saved: " + total) }

Generate More

Questions about programming?Chat with your personal AI assistant