Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace tESt
- {
- class Program
- {
- static void Main(string[] args)
- {
- var magnolia = int.Parse(Console.ReadLine());
- var hyacinth = int.Parse(Console.ReadLine());
- var rose = int.Parse(Console.ReadLine());
- var cactus = int.Parse(Console.ReadLine());
- var presantPrice = int.Parse(Console.ReadLine());
- const double magnoliaPrice = 3.25;
- const double hyacinthPrice = 4.00;
- const double rosePrice = 3.50;
- const double cactusPrice = 8.00;
- var profit = (magnolia * magnoliaPrice + hyacinth * hyacinthPrice +
- rose * rosePrice + cactus * cactusPrice) * 0.95; // 5% taxes
- var diff = presantPrice - profit;
- if (diff > 0)
- {
- diff = Math.Ceiling(diff);
- Console.WriteLine($"She is left with {diff} leva.");
- }
- else
- {
- diff = Math.Abs(diff);
- diff = Math.Floor(diff);
- Console.WriteLine($"She will have to borrow {diff} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment