Guest User

Пазар за плодове

a guest
Oct 6th, 2021
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. /*
  2.  * Created by SharpDevelop.
  3.  * User: Admin
  4.  * Date: 6.10.2021 г.
  5.  * Time: 9:08
  6.  *
  7.  * To change this template use Tools | Options | Coding | Edit Standard Headers.
  8.  */
  9. using System;
  10. using System.Text;
  11.  
  12. namespace zad7
  13. {
  14.     class Program
  15.     {
  16.         public static void Main(string[] args)
  17.         {
  18.             double strawberryPrice, bananasPrice;
  19.             double raspberryPrice, orangesPrice;
  20.            
  21.             double strawberry, bananas, raspberry, oranges;
  22.            
  23.             double totalPrice;
  24.            
  25.             Console.Write("Цена на ягодите: ");
  26.             strawberryPrice = double.Parse(Console.ReadLine());
  27.            
  28.             Console.Write("Количество банани: ");
  29.             bananas = double.Parse(Console.ReadLine());
  30.            
  31.             Console.Write("Количество портокали: ");
  32.             oranges = double.Parse(Console.ReadLine());
  33.            
  34.             Console.Write("Количество малини: ");
  35.             raspberry = double.Parse(Console.ReadLine());
  36.            
  37.             Console.Write("Количество ягоди: ");
  38.             strawberry = double.Parse(Console.ReadLine());
  39.            
  40.                        
  41.             raspberryPrice = strawberryPrice / 2;
  42.             orangesPrice = raspberryPrice * 0.6;
  43.             bananasPrice = raspberryPrice * 0.2;
  44.                
  45.             totalPrice = strawberryPrice * strawberry;
  46.             totalPrice += raspberryPrice * raspberry;
  47.             totalPrice += bananasPrice * bananas;
  48.             totalPrice += orangesPrice * oranges;
  49.            
  50.             Console.WriteLine("{0:f2}", totalPrice);
  51.            
  52.             Console.ReadKey(true);
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment