Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

boyanm avatar boyanm 0 Точки

Programming Basics Online Exam - 14 and 15 April 2018 3. Aluminium Joinery - имам нужда от помощ немога да разбера къде греша

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

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


            int Countdograma = int.Parse(Console.ReadLine());
            string Typedograma = Console.ReadLine();
            string typepolu4avane = Console.ReadLine();

            double prise = 0.0;

            switch (Typedograma)
            {
               case "90X130":

                    prise = 110;

                    if (Countdograma>=10)
                    {
                        if (Countdograma >= 30 && Countdograma < 60)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.05;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.05;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 60 && Countdograma < 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.08;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.08;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.08;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.08;
                                prise += 60;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }

                    }
                    
                    else
                    {
                        Console.WriteLine("Invalid order");
                    }


                    break;


                case "100X150":

                    prise = 140;
                    if (Countdograma>=10)
                    {
                        if (Countdograma >= 40 && Countdograma < 80)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.06;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.06;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 80 && Countdograma < 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.1;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.1;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.1;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.1;
                                prise += 60;
                                prise -= prise * 0.04;

                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                    }                    
                    else
                    {
                        Console.WriteLine("Invalid order");
                    }


                    break;


                case "130X180":

                    prise = 190;
                    if (Countdograma>=10)
                    {
                        if (Countdograma >= 20 && Countdograma < 50)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.07;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.07;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 50 && Countdograma < 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.12;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.12;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.12;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.12;
                                prise += 60;
                                prise -= prise * 0.04;


                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                    }                    
                    else
                    {
                        Console.WriteLine("Invalid order");
                    }


                    break;

                case "200X300":

                    prise = 250;

                    if (Countdograma>=10)
                    {
                        if (Countdograma >= 25 && Countdograma < 50)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.09;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.09;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 50 && Countdograma < 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.14;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.14;
                                prise += 60;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                        else if (Countdograma >= 99)
                        {
                            if (typepolu4avane == "Without delivery")
                            {

                                prise = prise * Countdograma;
                                prise -= prise * 0.14;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }
                            else if (typepolu4avane == "With delivery")
                            {
                                prise = prise * Countdograma;
                                prise -= prise * 0.14;
                                prise += 60;
                                prise -= prise * 0.04;
                                Console.WriteLine($"{prise:f2} BGN");
                            }

                        }
                    }                    
                    else
                    {
                        Console.WriteLine("Invalid order");
                    }

                    break;
            }
        }
    }
}

 

Тагове:
0
Programming Basics 23/04/2018 10:15:19
fbinnzhivko avatar fbinnzhivko 1586 Точки

Погледни това решение много дълго ми си струва твоето.

1
20/02/2021 18:52:04
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.