67
1
using System;
2
3
public class Program
4
{
5
6
public class Product
7
{
8
public string Code { get;set;}
9
public string Name { get;set;}
10
public string Description { get;set;}
11
public int Price { get;set;}
12
13
public Product(string Code, string Name, string Description, int Price)
14
{
15
if(String.IsNullOrWhiteSpace(Code))
16
throw new ArgumentNullException($"{nameof(this.Code)} cannot be empty");
17
else
18
this.Code =Code;
19
20
if(String.IsNullOrWhiteSpace(Name))
21
throw new ArgumentNullException($"{nameof(this.Name)} cannot be empty");
22
else
23
this.Name= Name;
24
Cached Result
Площадь первого прямоугольника равна 600, площадь второго прямоугольника равна 1035