Привет,нужна у меня есть прога на C# ,нет времени её завершить. Нужно добавить метод *add*,с которого я смогу добавлять модели телефонов и их характеристики. Заранее Вот код: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp4 { class Phone { public string Model = "Icarrot"; public string Display = "Rotina QHD"; public string Storage = "64 Tb"; public string OZU = "128 Gb"; public string CPU = "AMD Threadripper"; public int price = 123000; public int SimCard = 9; public void Print() { Console.WriteLine($"Модель = {Model},Дисплей = {Display},Память = {Storage},ОЗУ = {OZU},Процессор = {CPU},Стоимость = {price},Сим Карты = {SimCard}"); } public Phone(string Model, string Display, string Storage, string OZU, string CPU, int price, int SimCard) { this.Model = Model; this.Display = Display; this.Storage = Storage; this.OZU = OZU; this.CPU = CPU; this.price = price; this.SimCard = SimCard; } } class Program { static void Main(string[] args) { Phone phone = new Phone("Sasung", "VirviGlaZ", "8 Gb", "1 Gb", "Jlobdragon 109", 2899, 1); phone.Print(); } } }
uses Crt;
const n = 10;
var A: array [1..n] of integer;
i: integer;
begin
ClrScr;
Randomize;
WriteLn ( ' Massiv I: ');
for i:=1 to n do
begin
A[i] := 1+random(n);
Write (A[i]:4);
end;
WriteLn; WriteLn ( ' Massiv II: ');
for i:=1 to n do
begin
if (A[i] mod 2 =0) then A[i]:=0 else A[i]:=3*A[i];
Write (A[i]:4);
end;
ReadLn;
end.