Advertisement
Spocoman

Fruit Market

Aug 14th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FruitMarket
  4.  
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double strawberriesPrice = double.Parse(Console.ReadLine());
  11.             double bananasKg = double.Parse(Console.ReadLine());
  12.             double orangesKg = double.Parse(Console.ReadLine());
  13.             double raspberriesKg = double.Parse(Console.ReadLine());
  14.             double strawberriesKg = double.Parse(Console.ReadLine());
  15.  
  16.             double raspberriesPrice = strawberriesPrice / 2;
  17.             double orangesPrice = raspberriesPrice * 0.6;
  18.             double bananasPrice = raspberriesPrice / 5;
  19.  
  20.             double totalSum = strawberriesPrice * strawberriesKg + bananasPrice * bananasKg + orangesPrice * orangesKg + raspberriesPrice * raspberriesKg;
  21.  
  22.             Console.WriteLine($"{totalSum:F2}");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement