kala

mail@pastecode.io avatar
unknown
css
2 years ago
945 B
1
Indexable
Never
char type;
            double price, finalprice;
            for (int i = 0; i < 5; i++) //could be i+=n to have +n(s) steps
            {
                type = char.Parse(Console.ReadLine());
                price = double.Parse(Console.ReadLine());
                if (type == 'k')
                {
                    finalprice = price - 0.1 * price;
                    Console.WriteLine("Finalprice " + finalprice);
                }
                else
                {
                    if (type == 'p')
                    {
                        finalprice = price - 0.2 * price;
                        Console.WriteLine("Finalprice " + finalprice);
                    }
                    else
                    {
                        finalprice = price - 0.05 * price;
                        Console.WriteLine("Finalprice " + finalprice);
                    }
                }
            }