C#/C language

Advertisement


Question
Dear Alaa,
I want to ask u this question... CAn i draw 2 squares ( including the lines ) but the upper-left coordinate square 1 and square 2 can't be the same... example... if square 1 (3,5) then square 2 can't be (3,10) or ( 11,5 ) ?

If we use 'gotoxy' in turbo pascal, how to use the same function in C language ?

Regards,
Benny

Answer
Hi

Do you need in C#?  I know only C#.  

Try this

using System;

namespace Polymorph {
  public class Circle: Shape {
     private int radius;

     // constructor
     public Circle(int newx, int newy, int newradius): base(newx, newy) {
        setRadius(newradius);
     }

     // accessors for the radius
     public int getRadius() { return radius; }
     public void setRadius(int newradius) { radius = newradius; }

     // draw the circle
     public override void draw() {
        Console.WriteLine("Drawing a Circle at:({0},{1}), Radius {2}",
           getX(), getY(), getRadius());
     }
  }
}



Happy programming!!

-Srini

C#

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

can answer any kind of questions in ASP.NET, C#, VB.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, Coldfusion, Powerbuilder

©2012 About.com, a part of The New York Times Company. All rights reserved.