hawzze

fruitMarket_SoftUni

Jul 12th, 2020
57
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace softuni1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double lvStrawbwrries = double.Parse(Console.ReadLine());
  10.             double bananas = double.Parse(Console.ReadLine());
  11.             double orange = double.Parse(Console.ReadLine());
  12.             double raspberries = double.Parse(Console.ReadLine());
  13.             double kgStrawbwrries = double.Parse(Console.ReadLine());
  14.             double rasp = lvStrawbwrries / 2;
  15.             double bananasPrice = rasp - (0.8 * rasp);
  16.             double orangePrice = rasp - (0.4 * rasp);
  17.  
  18.             double raspberriesSum = raspberries * rasp;
  19.             double orangesSum = orange * orangePrice;
  20.             double bananasSum = bananasPrice * bananas;
  21.             double strawberriesSum = kgStrawbwrries * lvStrawbwrries;
  22.  
  23.             double total = raspberriesSum + orangesSum + bananasSum + strawberriesSum;
  24.             Console.WriteLine($"{ total:f2}");
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.         }
  32.  
  33.     }
  34. }
RAW Paste Data