Софтуерно Инженерство
Loading...
denitsadudinska avatar denitsadudinska 0 Точки

Complex Calculations -Small Shop

Zdraveite,

 

Moge li niakoi da mi pomogne da razbera ot kude mi idva greshkata. Merci predvaritelno.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Small_Shop
{
    class Program
    {
        static void Main(string[] args)
        {

         
        {
         
            {
                string product = Console.ReadLine().ToLower();
                string town = Console.ReadLine().ToLower();
                double quantity = double.Parse(Console.ReadLine());

                if (product == "coffee")

                {
                    if (town == "sofia")

                    {
                        Console.WriteLine(quantity * 0.50);

                    }
                    else if (town == "plovdiv")
                    {
                        Console.WriteLine(quantity * 0.40);

                    }

                    else if (town == "varna")

                    {
                        Console.WriteLine(quantity * 0.45);

                    }

                        if (product == "water")

                        {
                            if (town == "sofia")

                            {
                                Console.WriteLine(quantity * 0.80);

                            }
                            else if (town == "plovdiv")
                            {
                                Console.WriteLine(quantity * 0.70);

                            }

                            else if (town == "varna")

                            {
                                Console.WriteLine(quantity * 0.70);

                            }

                            else if (product == "beer")

                            {
                                if (town == "sofia")

                                {
                                    Console.WriteLine(quantity * 1.20);

                                }
                                else if (town == "plovdiv")
                                {
                                    Console.WriteLine(quantity * 1.15);

                                }

                                else if (town == "varna")

                                {
                                    Console.WriteLine(quantity * 1.10);

                                }


                                else if (product == "sweets")

                                {
                                    if (town == "sofia")

                                    {
                                        Console.WriteLine(quantity * 1.45);

                                    }
                                    else if (town == "plovdiv")
                                    {
                                        Console.WriteLine(quantity * 1.30);

                                    }

                                    else if (town == "varna")

                                    {
                                        Console.WriteLine(quantity * 1.35);

                                    }

                                    else if (product == "peanuts")

                                    {
                                        if (town == "sofia")

                                        {
                                            Console.WriteLine(quantity * 1.60);

                                        }
                                        else if (town == "plovdiv")
                                        {
                                            Console.WriteLine(quantity * 1.50);

                                        }

                                        else if (town == "varna")

                                        {
                                            Console.WriteLine(quantity * 1.55);

                                        }
                                    }
                    }

                            }
                        }
                    }
                }
            }
        }

    }
}

Тагове: