Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EasterDecoration
- {
- class Program
- {
- static void Main(string[] args)
- {
- int clients = int.Parse(Console.ReadLine());
- double total = 0;
- for (int i = 0; i < clients; i++)
- {
- string stock = Console.ReadLine();
- int counter = 0;
- double sum = 0;
- while (stock != "Finish")
- {
- switch (stock)
- {
- case "basket":
- sum += 1.5;
- break;
- case "wreath":
- sum += 3.8;
- break;
- case "chocolate bunny":
- sum += 7;
- break;
- }
- stock = Console.ReadLine();
- counter++;
- }
- if (counter % 2 == 0)
- {
- sum *= 0.8;
- }
- total += sum;
- Console.WriteLine($"You purchased {counter} items for {sum:F2} leva.");
- }
- Console.WriteLine($"Average bill per client is: {total / clients:F2} leva.");
- }
- }
- }
Add Comment
Please, Sign In to add comment