Advertisement
skipter

C# Fundamentals - Cake ingredients.

Jun 2nd, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp9
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string ingredient = Console.ReadLine();
  14.             int counter = 0;
  15.  
  16.             while (ingredient != "Bake!")
  17.             {
  18.                 Console.WriteLine($"Adding ingredient {ingredient}.");
  19.                 ingredient = Console.ReadLine();
  20.                 counter++;
  21.             }
  22.             Console.WriteLine($"Preparing cake with {counter} ingredients.");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement