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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int choco = int.Parse(Console.ReadLine());
- double milk = double.Parse(Console.ReadLine());
- double priceChoco = choco * 0.65;
- double priceMilk = milk * 2.70;
- double tangerine = Math.Floor(choco * 0.65);
- double priceTangerine = tangerine * 0.20;
- double priceAll = priceChoco + priceMilk + priceTangerine;
- if (budget >= priceAll)
- {
- Console.WriteLine($"You got this, {budget - priceAll:f2} money left!");
- }
- else
- {
- Console.WriteLine($"Not enough money, you need {priceAll - budget:f2} more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement