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 Shopping
- {
- class Program
- {
- static void Main(string[] args)
- {
- double Budget = double.Parse(Console.ReadLine());
- double chocolate = double.Parse(Console.ReadLine());
- double Milk = double.Parse(Console.ReadLine());
- double mandarins = Math.Truncate(chocolate - (chocolate * 0.35));
- mandarins *= 0.20;
- chocolate *= 0.65;
- Milk *= 2.70;
- double sum = 0.00;
- sum = mandarins + chocolate + Milk;
- bool check = Budget >= sum;
- if (check)
- {
- Budget -= sum;
- Console.WriteLine("You got this, {0:F2} money left!", Budget);
- }
- else
- {
- sum -= Budget;
- Console.WriteLine("Not enough money, you need {0:F2} more!", sum);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement