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)
- {
- //Input
- double breadPrice = double.Parse(Console.ReadLine());
- double breadCount = double.Parse(Console.ReadLine());
- double kozunaciCount = double.Parse(Console.ReadLine());
- double gevreciCount = double.Parse(Console.ReadLine());
- double kroasaniCount = double.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- //Calcs
- double kozunaciPrice = breadPrice * 1.2;
- double gevrekPrice = kozunaciPrice * 0.6;
- double kroasanPrice = gevrekPrice + 1.20;
- double Total = breadPrice * breadCount + kozunaciPrice * kozunaciCount + gevrekPrice * gevreciCount + kroasanPrice * kroasaniCount;
- if (Total <= budget)
- {
- Console.WriteLine($"Yes! {Math.Abs(Total - budget):F2} leva left.");
- }
- else
- {
- Console.WriteLine($"No! {Math.Abs(Total - budget):F2} leva need.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement