Професионална програма
Loading...
kostanikolov avatar kostanikolov 45 Точки

C# Задача: Scholarship/Стипендии. Основи на програмирането

https://pastebin.com/L0wghdip

Колеги, моля ви, помагайте. Много се умотах с проверките на тази задача и не мога да измисля, как да ги наредя.

условие - https://judge.softuni.bg/Contests/Practice/DownloadResource/2342

 

Задачата е от изпита на 03.09.2017

0
Programming Basics 11/12/2017 13:02:21
IvanovIvo avatar IvanovIvo 1 Точки

Ето го и моето алтернативно решение. Малко по-дълго е, но според мен е по-описателно. Успех :)

https://pastebin.com/gSxKrYu8

0
11/12/2017 18:50:49
valio90 avatar valio90 6 Точки

using System;

namespace _3._8Scholarship
{
    class Scholarship
    {
        static void Main(string[] args)
        {
            double dohod = double.Parse(Console.ReadLine());
            double uspeh = double.Parse(Console.ReadLine());
            double minZaplata = double.Parse(Console.ReadLine());

            double minstip = 0.35 * minZaplata;
            double stipUspeh = uspeh * 25;

            if (uspeh >= 5.50)
            {
                Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(stipUspeh)} BGN");
            }
            else if (dohod < minZaplata)
            {
                 if (uspeh >= 5.50)
                {
                    Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(stipUspeh)}BGN");
                }
                else if (uspeh > 4.50)
                {
                    Console.WriteLine($"You get a Social scholarship {Math.Floor(minstip)} BGN");
                }
               
                else
                {
                    Console.WriteLine("You cannot get a scholarship!");
                }
            }
            else if (dohod > minZaplata)
            {
                if (uspeh >= 5.50)
                {
                    Console.WriteLine($"You get a scholarship for excellent results {Math.Floor(stipUspeh)} BGN");
                }
                else if (uspeh > 4.50)
                {
                    Console.WriteLine("You cannot get a scholarship!");
                }
                else
                {

                    Console.WriteLine("You cannot get a scholarship!");
                }
            }
            
            else if (uspeh < 5.50)
            {
                Console.WriteLine("You cannot get a scholarship!");
            }
            
        }
    }
}

0
25/10/2019 15:43:25
em3ata avatar em3ata 2 Точки

using System;

namespace Scholarship
{
    class Program
    {
        static void Main(string[] args)
        {
            double income = double.Parse(Console.ReadLine());
            double grade = double.Parse(Console.ReadLine());
            double minimumWage = double.Parse(Console.ReadLine());

            double socialScholarship = minimumWage * 0.35;
            double excellentScholarship = grade * 25;

            if (income > minimumWage && grade > 4.5)
            {
                Console.WriteLine("You cannot get a scholarship!");
            }
            else if (income < minimumWage && grade > 5.5)
            {
                if (excellentScholarship > socialScholarship || socialScholarship > excellentScholarship || socialScholarship == excellentScholarship)
                {
                    Console.WriteLine($"You get a social scholarship {excellentScholarship}");
                }
            }
            else if (income > minimumWage && grade > 5.5)
            {
                Console.WriteLine($"You get a scholarship for excellent results {excellentScholarship} BGN");
            }


        }
    }
}
 

0
01/09/2020 15:26:47