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;
- class Program
- {
- static void Main(string[] args)
- {
- decimal money = decimal.Parse(Console.ReadLine());
- decimal rate = decimal.Parse(Console.ReadLine());
- decimal pizzaPrice = decimal.Parse(Console.ReadLine());
- decimal lasagnaPrice = decimal.Parse(Console.ReadLine());
- decimal sandwichPrice = decimal.Parse(Console.ReadLine());
- decimal pizzaQuantity = decimal.Parse(Console.ReadLine());
- decimal lasagnaQuantity = decimal.Parse(Console.ReadLine());
- decimal sandwichQuantity = decimal.Parse(Console.ReadLine());
- decimal moneyNeeds = pizzaPrice / rate * pizzaQuantity +
- lasagnaPrice / rate * lasagnaQuantity + sandwichPrice / rate * sandwichQuantity;
- //Console.WriteLine(moneyNeeds);
- if (money >= moneyNeeds)
- {
- Console.WriteLine("Garfield is well fed, John is awesome. Money left: ${0:F2}.", Math.Abs(money - moneyNeeds));
- }
- else
- {
- Console.WriteLine("Garfield is hungry. John is a badass. Money needed: ${0:F2}.", Math.Abs(moneyNeeds-money));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement