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 _02.Flower_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberOfMagnolii = int.Parse(Console.ReadLine());
- int numberOfZumbuli = int.Parse(Console.ReadLine());
- int numberOfRoses = int.Parse(Console.ReadLine());
- int numberOfCactuses = int.Parse(Console.ReadLine());
- double presentPrice = double.Parse(Console.ReadLine());
- double magnoliiProfit = numberOfMagnolii * 3.25;
- double zumbuliProfit = numberOfZumbuli * 4.0;
- double rosesProfit = numberOfRoses * 3.5;
- double cactusesProfit = numberOfCactuses * 8.0;
- double totalProfit = magnoliiProfit + zumbuliProfit + rosesProfit + cactusesProfit;
- double totalProfitAfterTax = totalProfit - totalProfit * 0.05;
- if (totalProfitAfterTax >= presentPrice)
- {
- Console.WriteLine("She is left with {0} leva.", Math.Floor(totalProfitAfterTax - presentPrice));
- }
- else
- {
- Console.WriteLine("She will have to borrow {0} leva.", Math.Ceiling(presentPrice - totalProfitAfterTax));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment