Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _6.EasternDecoration
- {
- class Program
- {
- static void Main(string[] args)
- {
- // double basketPr = 1.5;
- // double wreathPr = 3.8;
- // double chocolateBunnyPr = 5;
- int items = 0;
- double sumPerClient = 0.0;
- double totalSum = 0.0;
- //int wreaths = 0;
- // int chocolateBunnys = 0;
- int clients = int.Parse(Console.ReadLine());
- for (int i = 1; i <= clients; i++)
- {
- string input = Console.ReadLine();
- while (input != "Finish")
- {
- switch (input)
- {
- case "basket": items++; sumPerClient += 1.5; break;
- case "wreath": items++; sumPerClient += 3.8; break;
- case "chocolate bunny": items++; sumPerClient += 7.0; break;
- // case "basket": items++;sumPerClient += 1.5;break;
- }
- input = Console.ReadLine();
- }
- if (items%2==0)
- {
- sumPerClient = sumPerClient - sumPerClient * 0.2;
- }
- Console.WriteLine($"You purchased {items} items for {sumPerClient:f2} leva.");
- items = 0;
- totalSum += sumPerClient;
- sumPerClient = 0;
- }
- Console.WriteLine($"Average bill per client is: {totalSum/clients:f2} leva.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement