Advertisement
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 Christmas_Market
- {
- class Program
- {
- static void Main(string[] args)
- {
- double fantasy = 14.90;
- double horror = 9.80;
- double romantic = 4.30;
- double salary = 0;
- double neededMoney = double.Parse(Console.ReadLine());
- int numberFantasy = int.Parse(Console.ReadLine());
- int numberHorror = int.Parse(Console.ReadLine());
- int numberRomantic = int.Parse(Console.ReadLine());
- double sum = fantasy * numberFantasy + horror * numberHorror + romantic * numberRomantic;
- sum -= sum * 0.20; // dds
- if (sum>= neededMoney)
- {
- salary = sum - neededMoney;
- double totalsalary = Math.Floor( salary * 0.10);
- totalsalary = (int)totalsalary;
- sum -= totalsalary;
- Console.WriteLine($"{sum:f2} leva donated.");
- Console.WriteLine($"Sellers will receive {totalsalary} leva.");
- }
- else
- {
- neededMoney -= sum;
- Console.WriteLine($"{neededMoney} money needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement