Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.55 KB | None | 0 0
  1. using System; using System.Globalization; using System.Threading;
  2. class Program { static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
  3. int tom = int.Parse(Console.ReadLine()); int areaTom = int.Parse(Console.ReadLine()); int cucumber = int.Parse(Console.ReadLine()); int areaCucumber = int.Parse(Console.ReadLine()); int potato = int.Parse(Console.ReadLine()); int areaPotato = int.Parse(Console.ReadLine()); int carrot = int.Parse(Console.ReadLine()); int areaCarrot = int.Parse(Console.ReadLine()); int cabbage = int.Parse(Console.ReadLine()); int areaCabbage = int.Parse(Console.ReadLine()); int beans = int.Parse(Console.ReadLine());
  4. decimal TomPrice = 0.5m; decimal CarrotPrice = 0.6m; decimal CucumberPrice = 0.4m; decimal CabbagePrice = 0.3m; decimal PotatoPrice = 0.25m; decimal BeansPrice = 0.4m;
  5. // Calculation tu vegetables;
  6. decimal resaltTuVeg = ((tom * TomPrice) + (carrot * CarrotPrice) + (cucumber * CucumberPrice) + (cabbage * CabbagePrice)+(potato * PotatoPrice)+(beans * BeansPrice));
  7.  
  8. // Calculation tu area;
  9. int area = 250; int resalrAreaTuVega = areaTom + areaCarrot + areaCucumber + areaCabbage + areaPotato; int areaBeans = area - resalrAreaTuVega;
  10. if (resalrAreaTuVega > area) { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("Insufficient area"); } else if (resalrAreaTuVega == area) { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("No area for beans"); }
  11. else { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("Beans area:{0}", areaBeans); } } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement