Question: This is in C sharp, all help would be appreciated! 1. The following program attempts to override the Shape class (attachedl to create an Oval
This is in C sharp, all help would be appreciated!
1. The following program attempts to override the Shape class (attachedl to create an Oval with a given center point, x-diameter, and y-diameter. Find and correct any errors public class Oval: Shape int xdiam; int ydiam public Oval(Point p, int ma, int mi) diam ma ydiam mi; public override void Draw(Graphics g) g.FillEllipse Brushes.Red, location.X-2*xdiam, location.Y-2ry diam, xdiam, ydiam); public class Ex10_8: Form Shape s; public Ex10_8)1 Size - new Size(300,200); s new Oval(new Point(100,100), 70, 30); protected override void OnPaint(PaintEventArgs e) Graphics g -e.Graphics; s.Draw(g) base.OnPaint(e static void Main() Application.Run(new Ex10_8(); 1. The following program attempts to override the Shape class (attachedl to create an Oval with a given center point, x-diameter, and y-diameter. Find and correct any errors public class Oval: Shape int xdiam; int ydiam public Oval(Point p, int ma, int mi) diam ma ydiam mi; public override void Draw(Graphics g) g.FillEllipse Brushes.Red, location.X-2*xdiam, location.Y-2ry diam, xdiam, ydiam); public class Ex10_8: Form Shape s; public Ex10_8)1 Size - new Size(300,200); s new Oval(new Point(100,100), 70, 30); protected override void OnPaint(PaintEventArgs e) Graphics g -e.Graphics; s.Draw(g) base.OnPaint(e static void Main() Application.Run(new Ex10_8()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
