Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Created by SharpDevelop.
- * User: Admin
- * Date: 6.10.2021 г.
- * Time: 9:08
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
- using System;
- using System.Text;
- namespace zad7
- {
- class Program
- {
- public static void Main(string[] args)
- {
- double strawberryPrice, bananasPrice;
- double raspberryPrice, orangesPrice;
- double strawberry, bananas, raspberry, oranges;
- double totalPrice;
- Console.Write("Цена на ягодите: ");
- strawberryPrice = double.Parse(Console.ReadLine());
- Console.Write("Количество банани: ");
- bananas = double.Parse(Console.ReadLine());
- Console.Write("Количество портокали: ");
- oranges = double.Parse(Console.ReadLine());
- Console.Write("Количество малини: ");
- raspberry = double.Parse(Console.ReadLine());
- Console.Write("Количество ягоди: ");
- strawberry = double.Parse(Console.ReadLine());
- raspberryPrice = strawberryPrice / 2;
- orangesPrice = raspberryPrice * 0.6;
- bananasPrice = raspberryPrice * 0.2;
- totalPrice = strawberryPrice * strawberry;
- totalPrice += raspberryPrice * raspberry;
- totalPrice += bananasPrice * bananas;
- totalPrice += orangesPrice * oranges;
- Console.WriteLine("{0:f2}", totalPrice);
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment