Programming Basics
Моля за малко помощ.Бъркам при първото изчисление за влака.
03. Vacation
https://judge.softuni.bg/Contests/354/Programming-Basics-Exam-20-November-2016-Morning
using System;
namespace Vacation
{
class Vacation
{
static void Main()
{
double adults = double.Parse(Console.ReadLine());
double students = double.Parse(Console.ReadLine());
double nightsHotel = double.Parse(Console.ReadLine());
string transport = Console.ReadLine().ToLower();
double sum = 0;
double costTransport = 0;
double commission;
int group = 0;
if (transport == "train" )
{
if (group >= 50)
{
costTransport = (adults * 24.99) + (students * 14.99);
nightsHotel *= 82.99;
commission = (costTransport + nightsHotel) * 0.10;
sum = (costTransport + nightsHotel + commission);
sum *= 0.50;
}
}
else if (transport == "bus")
{
costTransport = (adults * 32.50 + students * 28.50) * 2;
nightsHotel *= 82.99;
commission = (costTransport + nightsHotel) * 0.10;
sum = (costTransport + nightsHotel + commission);
}
else if (transport == "boat")
{
costTransport = (adults * 42.99 + students * 39.99) * 2;
nightsHotel *= 82.99;
commission = (costTransport + nightsHotel) * 0.10;
sum = (costTransport + nightsHotel + commission);
}
else if (transport == "airplane")
{
costTransport = (adults * 70.00 + students * 50.00) * 2;
nightsHotel *= 82.99;
commission = (costTransport + nightsHotel) * 0.10;
sum = (costTransport + nightsHotel + commission);
}
Console.WriteLine($"{sum:f2}");
}
}
}
Благодаря за вниманието!
Само,ако може да ми обясните,защо умножавате по (1.10).Това не го разбрах?.