Generation

generate functionTue, 02 May 2023

Implementar aplicación que simule el proceso de un peaje, el cual desea saber cuántos vehículos de cada tipo pasaron por el peaje y la cantidad total de lo recaudado. Los tipos de vehículos son: automóvil (S/.5.50), camión (S/7.50), camioneta (S/7.50) y ómnibus (S/9.00) .

Script function peaje(vehiculo, cantidad){ if (vehiculo == "Automovil") { return 5.5 * cantidad } else if (vehiculo == "Camion") { return 7.5 * cantidad } else if (vehiculo == "Camioneta") { return 7.5 * cantidad } else if (vehiculo == "Omnibus") { return 9 * cantidad } else { return 0 } } peaje("Automovil", 2)

Questions about programming?Chat with your personal AI assistant