Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _07.FruitMarket
- {
- class Program
- {
- static void Main(string[] args)
- {
- double strawberriesPrice = double.Parse(Console.ReadLine());
- double bananasAmount = double.Parse(Console.ReadLine());
- double orangesAmount = double.Parse(Console.ReadLine());
- double raspberriesAmount = double.Parse(Console.ReadLine());
- double strawberriesAmount = double.Parse(Console.ReadLine());
- double raspberriesPrice = strawberriesPrice / 2;
- double orangesPrice = raspberriesPrice - (raspberriesPrice * 0.40);
- double bananasPrice = raspberriesPrice - (raspberriesPrice * 0.80);
- double raspberriesNeededSum = raspberriesAmount * raspberriesPrice;
- double orangesNeededSum = orangesAmount * orangesPrice;
- double bananasNeededSum = bananasAmount * bananasPrice;
- double strawberriesNeededSum = strawberriesAmount * strawberriesPrice;
- double neededSum = raspberriesNeededSum + orangesNeededSum + bananasNeededSum + strawberriesNeededSum;
- Console.WriteLine($"{neededSum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement