-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBeverage.cs
More file actions
34 lines (31 loc) · 913 Bytes
/
Beverage.cs
File metadata and controls
34 lines (31 loc) · 913 Bytes
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
using System;
using System.Collections.Generic;
using System.Text;
namespace ListBeverages
{
internal abstract class Beverage
{
public float Ounces { get; set; }
public bool IsHot { get; set; }
public float Temperature { get; set; }
public string[]? Ingrediants { get; set; }
public string? Instructions { get; set; }
public string? Flavor { get; set; }
public string? Name { get; set; }
// Indexer
public string this[int index]
{
get
{
if (index > 0 && index < Ingrediants.Length)
return Ingrediants[index];
return "Out of bounds index";
}
set
{
if(index > 0 && index < Ingrediants.Length)
Ingrediants[index] = value;
}
}
}
}