Apuntes
Sin título
Contenido del apunte (1)
Página 1
int vehicle = int.Parse(Console.ReadLine());
double hours = double.Parse(Console.ReadLine());
if (hours <= 0) { Console.WriteLine("Error!"); } else
{ double price = 0;
double finalPrice = 0
; switch (vehicle)
{ case 1: price = 2
; break
; case 2:
price = 5
; break;
default:
Console.WriteLine("Not valid!")
; break;
} finalPrice = price * hours;
if (hours > 10) { finalPrice = finalPrice * 0.8; } Console.WriteLine(Math.Round(finalPrice
Información
- Descripción
- Apunte sobre Sin título, creado por Симеон Енгьозов el 27/04/2026.
- Creado por
- Симеон Енгьозов · abr 2026
- Actualizado
- 27 abr 2026
- Visitas
- 1
- Valoración