Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _18_scholarship
- {
- class Program
- {
- static void Main(string[] args)
- {
- // user input
- var income = double.Parse(Console.ReadLine());
- var score = double.Parse(Console.ReadLine());
- var mrz = double.Parse(Console.ReadLine());
- // define variables
- double socialScholarship = 0.0;
- double excelScholarship = 0.0;
- double scholarship = 0.0;
- // socieal scholarship
- socialScholarship = Math.Floor( (income < mrz && score > 4.50) ? mrz * 0.35 : 0.0 );
- // excellent score
- excelScholarship = Math.Floor( (score >= 5.50) ? score * 25 : 0.0 );
- // bigger schilarship
- scholarship = Math.Max(socialScholarship, excelScholarship);
- if (scholarship == 0.0)
- {
- Console.WriteLine("You cannot get a scholarship!");
- }
- else
- {
- if (socialScholarship > excelScholarship)
- {
- Console.WriteLine("You get a Social scholarship {0} BGN",
- socialScholarship);
- }
- else
- {
- Console.WriteLine("You get a scholarship for " +
- "excellent results {0} BGN", excelScholarship);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment