Professional Documents
Culture Documents
Animales
Animales
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace _1.__EspeciesAnimales
public Form1()
InitializeComponent();
comboBoxAnimal.DataSource = null;
switch (comboBoxanimaltype.SelectedIndex)
{
case 0:
comboBoxAnimal.DataSource = listM;
break;
case 1:
comboBoxAnimal.DataSource = listA;
break;
comboBoxAnimal.SelectedIndex = 0;
switch (comboBoxAnimal.SelectedItem)
case "Cat":
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
Convert.ToInt32(txtjumpdistance.Text), comboBoxrace.SelectedItem.ToString());
break;
case "Dog":
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
Convert.ToInt32(txtjumpdistance.Text), comboBoxrace.SelectedItem.ToString());
break;
case "Orca":
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
Convert.ToInt32(txtjumpdistance.Text), comboBoxrace.SelectedItem.ToString());
break;
case "Duck":
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
, comboBoxrace.SelectedItem.ToString());
break;
case "Hawk":
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
, comboBoxrace.SelectedItem.ToString());
break;
case "Hummingbird":
ClsHummingbird objHummingbird = new ClsHummingbird(txtname.Text,
txtscientificname.Text,
Convert.ToDouble(txtweigth.Text), Convert.ToDouble(txtheigth.Text),
, comboBoxrace.SelectedItem.ToString());
break;
simpleSound.Play();
comboBoxrace.DataSource = null;
switch (comboBoxAnimal.SelectedItem)
case "Cat":
comboBoxrace.DataSource = listracecat;
pictureBox1.Image = Image.FromFile("cat.png");
break;
case "Dog":
comboBoxrace.DataSource = listracedog;
pictureBox1.Image = Image.FromFile("dog.png");
break;
case "Orca":
comboBoxrace.DataSource = listraceorca;
pictureBox1.Image = Image.FromFile("orca.png");
break;
case "Duck":
comboBoxrace.DataSource = listraceduck;
pictureBox1.Image = Image.FromFile("duck.png");
break;
case "Hawk":
comboBoxrace.DataSource = listracehawk;
pictureBox1.Image = Image.FromFile("hawk.png");
break;
case "Hummingbird":
comboBoxrace.DataSource = listracehummingbird;
pictureBox1.Image = Image.FromFile("hummingbird.png");
break;
switch (comboBoxrace.SelectedItem)
case "Persa":
pictureBox1.Image = Image.FromFile("persa.png");
break;
case "Siames":
pictureBox1.Image = Image.FromFile("siames.png");
break;
case "Angora":
pictureBox1.Image = Image.FromFile("angora.png");
break;
case "Bengali":
pictureBox1.Image = Image.FromFile("bengali.png");
break;
case "Siberiano":
pictureBox1.Image = Image.FromFile("siberiano.png");
break;
case "Beagle":
pictureBox1.Image = Image.FromFile("Beagle.png");
break;
case "Pitbull":
pictureBox1.Image = Image.FromFile("Pitbull.png");
break;
case "Golden":
pictureBox1.Image = Image.FromFile("Golden.png");
break;
case "Husky":
pictureBox1.Image = Image.FromFile("Husky.png");
break;
case "Pug":
pictureBox1.Image = Image.FromFile("Pug.png");
break;
case "Residents":
pictureBox1.Image = Image.FromFile("Residents.png");
break;
case "Passersby":
pictureBox1.Image = Image.FromFile("Passersby.png");
break;
case "Maritime":
pictureBox1.Image = Image.FromFile("Maritime.png");
break;
case "Pekin":
pictureBox1.Image = Image.FromFile("Pekin.png");
break;
case "Rouen":
pictureBox1.Image = Image.FromFile("Rouen.jpg");
break;
case "Mexicano":
pictureBox1.Image = Image.FromFile("Mexicano.jpg");
break;
case "Campbell":
pictureBox1.Image = Image.FromFile("Campbell.jpg");
break;
case "Alcotanes":
pictureBox1.Image = Image.FromFile("Alcotanes.jpg");
break;
case "Kestrels":
pictureBox1.Image = Image.FromFile("Kestrels.png");
break;
case "Hawks":
pictureBox1.Image = Image.FromFile("Hawks.png");
break;
case "Glittering":
pictureBox1.Image = Image.FromFile("Glittering.png");
break;
case "Brown":
pictureBox1.Image = Image.FromFile("Brown.jpg");
break;
case "Purple-eared":
pictureBox1.Image = Image.FromFile("Purple-eared.png");
break;
case "Trochilinae":
pictureBox1.Image = Image.FromFile("Trochilinae.jpg");
break;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal abstract class ClsAnimal
{
protected string name;
protected string scientificname;
protected double weight;
protected double height;
protected string colour;
protected string timelife;
protected string imagen;
namespace _1.__EspeciesAnimales
{
internal abstract class ClsMammals:ClsAnimal
{
protected string gestationtime;
namespace _1.__EspeciesAnimales
{
internal class ClsCat:ClsMammals
{
protected int jumpdistance;
protected string race;
public ClsCat(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, int jumpdistance, string race)
:base( name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.jumpdistance = jumpdistance;
this.race = race;
}
public override string Feed()
{
return "\nIt is fed on croquettes ";
}
public override string Communicate()
{
return "\nPurr Maulla Miau ";
}
public override string Displace()
{
return "\nMoves to four limbs ";
}
public override string Breathe()
{
return "\nPulmonary Respitation ";
}
public override string ToString()
{
return base.ToString() + String.Format($"Jump distance: {jumpdistance}\tRace: {race}"); ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal class ClsDog:ClsMammals
{
protected int jumpdistance;
protected string race;
public ClsDog(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, int jumpdistance, string race)
: base(name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.jumpdistance = jumpdistance;
this.race = race;
}
public override string Feed()
{
return "\nIt is fed on croquettes ";
}
public override string Communicate()
{
return "\nBarks Wuaow ";
}
public override string Displace()
{
return "\nMoves to four limbs ";
}
public override string Breathe()
{
return "\nPulmonary Respitation ";
}
public override string ToString()
{
return base.ToString() + String.Format($"Jump distance: {jumpdistance}\tRace: {race}"); ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal class ClsOrca:ClsMammals
{
protected int jumpdistance;
protected string race;
public ClsOrca(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, int jumpdistance, string race)
: base(name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.jumpdistance = jumpdistance;
this.race = race;
}
public override string Feed()
{
return "\nThey feed on salmon, cod, herring, hake and halibut ";
}
public override string Communicate()
{
return "\nThey communicate using clicks and whistles that are very important to them ";
}
public override string Displace()
{
return "\nBody movement and fins ";
}
public override string Breathe()
{
return "\nPulmonary Respitation ";
}
public override string ToString()
{
return base.ToString() + String.Format($"Jump distance: {jumpdistance}\tRace: {race}"); ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal abstract class ClsBirds:ClsAnimal
{
protected string gestationtime;
protected ClsBirds(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime) : base(name, scientificname,
weight,
height, colour, timelife, imagen)
{
this.gestationtime = gestationtime;
}
public override string ToString()
{
return base.ToString() + "\nBirds are warm-blooded vertebrate animals that have a feathered body, wings as
forelimbs, and a beak ";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal class ClsDuck:ClsBirds
{
protected string race;
public ClsDuck(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, string race)
: base(name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.race = race;
}
public override string Feed()
{
return "\nThey feed on algae, fish, plants, insects, seeds and some pebbles or sand ";
}
public override string Communicate()
{
return "\nshaking head and tail Cuack ";
}
public override string Displace()
{
return "\nMoves to two limbs ";
}
public override string Breathe()
{
return "\nPulmonary Respitation ";
}
public override string ToString()
{
return base.ToString() + String.Format($"\tRace: {race}"); ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal class ClsHawk:ClsBirds
{
protected string race;
public ClsHawk(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, string race)
: base(name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.race = race;
}
public override string Feed()
{
return "\nThey feed on insects, rodents, small and medium birds ";
}
public override string Communicate()
{
return "\nvisually or through sounds ";
}
public override string Displace()
{
return "\nThey fly with their two wings ";
}
public override string Breathe()
{
return "\nPulmonary Respitation ";
}
public override string ToString()
{
return base.ToString() + String.Format($"\tRace: {race}"); ;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _1.__EspeciesAnimales
{
internal class ClsHummingbird:ClsBirds
{
protected string race;
public ClsHummingbird(string name, string scientificname, double weight,
double height, string colour, string timelife, string imagen, string gestationtime, string race)
: base(name, scientificname, weight, height, colour, timelife, imagen, gestationtime)
{
this.race = race;
}
public override string Feed()
{
return "\nIt feeds on the nectar of the flowers ";
}
public override string Communicate()
{
return "\nThey communicate through a variety of visual and vocalizations often performed in conjunction
with one another ";
}
public override string Displace()
{
return "\nThey fly with their two wings ";
}
public override string Breathe()
{
return "\nAerobic Respiration ";
}
public override string ToString()
{
return base.ToString() + String.Format($"\tRace: {race}"); ;
}
}
}
App: