I need C# code for this. Please do not miss anything, fulfull all the requiremen
ID: 3840619 • Letter: I
Question
I need C# code for this. Please do not miss anything, fulfull all the requirements and send me the complete code. Really thankful. Also do comments on it
Part B. Homework Windows Form Application (ONLY SUBMIT THIS PORTION) 1. Create a windows form application, shown in Figure 1. 2. Create an Animal class with properties for skin Type, food Type and methods called Eat0, Move0, and Reproduce (0. 3 Extend the Animal class and create 3 derived classes for any three animals. Derived class should have a method for something unique that your animal does. For example if you choose dog, a Dog class might have a WagTail or Catch Frisbee method. 4. Add window controls to select any of the 3 animals 5. Pictures of the animals should change when their radio button is selected. 6. Add 6 buttons for Skin Type, FoodType and Eat, Move, Reproduce and unique Method. 7. When each button is clicked, display a label showing that the animal can use its inherited features. When the unique attribute button is clicked, display a label showing your animal can perform its unique Method. Example output: a The Animal Farm Cat O Dog o Chicken Base aass Properties Base aass Methods Derived aast Method Skin Type Food Type Feathers Figure 1 -The Windows Form Application for The Animal FarmExplanation / Answer
Class File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApplication2
{
public class Animal
{
public string skinType, foodType;
public virtual string Eat()
{
return "";
}
public virtual string Move()
{ return ""; }
public virtual string Reproduce()
{
return "";
}
}
public class Cat : Animal
{
public override string Eat()
{
base.Eat();
return "meat";
}
public override string Move()
{
base.Move();
return "locomotion or steals";
}
public override string Reproduce()
{
base.Reproduce();
return "prolific breeders";
}
public string unique()
{
return "Outdoor intact (males cover 3 to 5 miles of their trails of previously marked territory";
}
}
public class Dog : Animal
{
public override string Eat()
{
base.Eat();
return "Peanut butter";
}
public override string Move()
{
base.Move();
return " Runs";
}
public override string Reproduce()
{
base.Reproduce();
return " sexual reproduction";
}
public string unique()
{
return "Catch FrisBee or WagTail";
}
}
class Chicken : Animal
{
public override string Eat()
{
base.Eat();
return "grains";
}
public override string Move()
{
base.Move();
return "struts";
}
public override string Reproduce()
{
base.Reproduce();
return "oviparous";
}
public string unique()
{
return "squat and rounded appearance";
}
}
}
Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void cat_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("cat.jpg");
}
private void dog_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("dog.jpg");
}
private void chicken_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("chicken.jpg");
}
private void button6_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
label1.Text = c1.unique();
}
else if (dog.Checked == true)
{
label1.Text = d1.unique();
}
else if (chicken.Checked == true)
{
label1.Text = ch.unique();
}
}
private void button1_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
c1.skinType = "Hairs";
label1.Text = c1.skinType;
}
else if (dog.Checked==true )
{
d1.skinType = "Hairs";
label1.Text = d1.skinType;
}
else if (chicken.Checked ==true )
{
ch.skinType = "Feathers";
label1.Text = ch.skinType;
}
}
private void button2_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
c1.foodType = "Mostly NonVeg";
label1.Text = c1.foodType;
}
else if (dog.Checked == true)
{
d1.foodType = "Mostly NonVeg";
label1.Text = d1.foodType;
}
else if (chicken.Checked == true)
{
ch.foodType = "Veg and NonVeg";
label1.Text = ch.foodType;
}
}
private void button3_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
label1.Text = c1.Eat();
}
else if (dog.Checked == true)
{
label1.Text = d1.Eat();
}
else if (chicken.Checked == true)
{
label1.Text = ch.Eat();
}
}
private void button4_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
label1.Text = c1.Move ();
}
else if (dog.Checked == true)
{
label1.Text = d1.Move();
}
else if (chicken.Checked == true)
{
label1.Text = ch.Move();
}
}
private void button5_Click(object sender, EventArgs e)
{
Cat c1 = new Cat();
Dog d1 = new Dog();
Chicken ch = new Chicken();
if (cat.Checked == true)
{
label1.Text = c1.Reproduce ();
}
else if (dog.Checked == true)
{
label1.Text = d1.Reproduce();
}
else if (chicken.Checked == true)
{
label1.Text = ch.Reproduce();
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.