You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
577 B

2 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Builder.Products
{
internal class Product
{
private List<object> _parts = new List<object>();
public void Add(string part)
{
_parts.Add(part);
}
public string ListParts()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < _parts.Count; i++)
{
sb.Append($"{_parts[i]}");
if (i < _parts.Count - 1)
sb.Append(", ");
}
return $"Product parts: {sb.ToString() + Environment.NewLine}";
}
}
}