Advertisement
martinvalchev

Cake_Ingredients

Jan 28th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Cake_Ingredients
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string product = Console.ReadLine();
  10.             int counter = 0;
  11.  
  12.             while (product != "Bake!")
  13.             {
  14.                 Console.WriteLine($"Adding ingredient {product}.");
  15.                 counter++;
  16.                 product = Console.ReadLine();
  17.             }
  18.             Console.WriteLine($"Preparing cake with {counter} ingredients.");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement