11 Replies
using System;
using System.Data;
using System.Linq.Expressions;
using System.Net.Security;
using System.Diagnostics;
using System.IO;
using System.ComponentModel.DataAnnotations;
using System.Xml.Schema;
namespace Program;
class Bird
{
public string color;
public int amount;
public Bird(string color_bird, int amount_bird)
{
color = color_bird;
amount = amount_bird;
}
static void Main(string[] args)
{
Random random = new Random();
string[] parrots = { "Parrot", "Ara", "Sun conure", "Lovebird", "Cockatoo", "Macaws", "Lorikeets", "Scarlet Macaw", "Kākāpō", "Parakeets", "Senegal parrot", "Caiques", "Amazon parrot", "Parrotlet", "Burrowing parrot", "Cockatiel", "African Grey", "Eclectus", "Pionus parrot", "Budgerigar", "African Greys" };
string[] colors = { "Blue", "Red", "Green" };
for (int i = 0; i < parrots.Length; i++)
{
int num = random.Next();
int start = random.Next(0, colors.Length);
Bird parrots[i] new Bird(colors[start], num);
Console.WriteLine(parrots[i].color);
Console.WriteLine(parrots[i].amount);
}
}
}
logical error with this code.
uhm
o
i see
bruh
thx
don't forget to type
/close
and press enter./close
@Winter dissi
Another simpler one:
🙂