Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int tomatoSeeds = int.Parse(Console.ReadLine());
- int tomatoArea = int.Parse(Console.ReadLine());
- decimal tomatoCost = 0.50m;
- int cucumberSeeds = int.Parse(Console.ReadLine());
- int cucumberArea = int.Parse(Console.ReadLine());
- decimal cucumberCost = 0.40m;
- int potatoSeeds = int.Parse(Console.ReadLine());
- int potatoArea = int.Parse(Console.ReadLine());
- decimal potatoCost = 0.25m;
- int carrotSeeds = int.Parse(Console.ReadLine());
- int carrotArea = int.Parse(Console.ReadLine());
- decimal carrotCost = 0.60m;
- int cabbageSeeds = int.Parse(Console.ReadLine());
- int cabbageArea = int.Parse(Console.ReadLine());
- decimal cabbageCost = 0.30m;
- int beansSeeds = int.Parse(Console.ReadLine());
- decimal beansCost = 0.40m;
- decimal totalPrice = (tomatoSeeds * tomatoCost) + (cucumberSeeds * cucumberCost) + (potatoSeeds * potatoCost) + (carrotSeeds * carrotCost) + (cabbageSeeds * cabbageCost) + (beansSeeds*beansCost);
- int totalArea = tomatoArea + cucumberArea + potatoArea + carrotArea + cabbageArea;
- int areaAvailable = 250;
- int areaBeans = areaAvailable - totalArea;
- if (areaBeans > 0) {
- Console.WriteLine("Total costs: {0:0.00}", totalPrice);
- Console.WriteLine("Beans area: {0}", areaBeans);
- }
- if (totalArea > areaAvailable) {
- Console.WriteLine("Total costs: {0:0.00}", totalPrice);
- Console.WriteLine("Insufficent area");
- }
- if (areaBeans <= 0 && areaAvailable >= totalArea ) {
- Console.WriteLine("Total costs: {0:0.00}", totalPrice);
- Console.WriteLine("No area for beans");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement