Practicing Enumerator
Fill in the blanks to complete the enum definition. Read the code and figure out what is the enum's name, also which members it should have.
index.cs
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
class Program
{
// Fill in the blanks below this line
___ ___
{
___
}
static void Main(string[] args)
{
Potion potion = Potion.Invisibility;
switch (potion)
{
case Potion.Invisibility:
Console.WriteLine("You drink the Invisibility potion and vanish from sight!");
break;
case Potion.Strength:
Console.WriteLine("You drink the Strength potion and feel a surge of power!");
break;
case Potion.Healing:
Console.WriteLine("You drink the Healing potion and your wounds magically mend.");
break;
case Potion.FireResistance:
Console.WriteLine("You drink the Fire Resistance potion and become impervious to flames.");
break;
case Potion.Teleportation:
Console.WriteLine("You drink the Teleportation potion and find yourself in a new location!");
break;
default:
Console.WriteLine("Invalid potion type!");
break;
}
}
12345678910111213141516171819202122232425262728293031323334353637using System; class Program { // Fill in the blanks below this line ___ ___ { ___ } static void Main(string[] args) { Potion potion = Potion.Invisibility; switch (potion) { case Potion.Invisibility: Console.WriteLine("You drink the Invisibility potion and vanish from sight!"); break; case Potion.Strength: Console.WriteLine("You drink the Strength potion and feel a surge of power!"); break; case Potion.Healing: Console.WriteLine("You drink the Healing potion and your wounds magically mend."); break; case Potion.FireResistance: Console.WriteLine("You drink the Fire Resistance potion and become impervious to flames."); break; case Potion.Teleportation: Console.WriteLine("You drink the Teleportation potion and find yourself in a new location!"); break; default: Console.WriteLine("Invalid potion type!"); break; } } }
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 11
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo