none
c# RRS feed

  • Question

  • John is a software developer, who works for Mega Technologies. He is currently under the project
    of geometric calculations. The program that John has to develop should:
    Calculate the area of circle.
    Calculate the volume of the cube.
    Help John to develop the program using an interface.

    Sunday, May 12, 2013 7:56 AM

Answers

  • Hi

      public interface IShape
        {
            double Volume();
            double Area();
        }
        class Circle : IShape
        {
            public int radius { get; set; }
            public double Volume()
            {
                return (4 / 3) * Math.PI * radius * radius * radius;
            }
    
            public double Area()
            {
    
                return Math.PI * radius * radius;
            }
        }

    Refer Article

    Regards

    Monday, May 13, 2013 11:15 AM
  • You build form 1 with two buttons "Area for Circle" and "Volume for Cube" and link them to their respective forms.

    Then take text box(or whatever you may like) as user's entry field for radius and calculate the area of the respective figure.

    You can also do this in a single page taking the radius, and keeping two radio buttons for circle and for Cube, one button "Calculate" and another field to show result.


    Tuesday, May 14, 2013 1:33 AM

All replies

  • John, send me your email address and any questions you may have.  I'll see what I can do to help.

    Paul Linton

    Sunday, May 12, 2013 8:42 AM
  • Paul, do you really want to be doing the guy's homework for him?

    He could ask specific questions here about interfaces and we'd be happy to help him out here, so that it will benefit others. By asking him to contact you via email, you'll end up being suckered into writing his whole app for him, plus no one else here on the forums will benefit.


    ~~Bonnie Berent DeWitt [C# MVP]

    geek-goddess-bonnie.blogspot.com

    Sunday, May 12, 2013 4:59 PM
    Moderator
    1. John, send me your email address and any questions you may have.  I'll see what I can do to help.Paul Linton

    my email id is jha.hemant40@gmail.com and thanks sir in advance.
    Sunday, May 12, 2013 5:53 PM
  • Bonnie, I'm not asking the original poster to contact me, I am asking John to contact me...  If it is homework then John does not exist.  If it is not homework then I will make sure that John from Mega Technologies posts any specific questions here, he may just need help in using the editor or creating an account on this site.


    Paul Linton

    Monday, May 13, 2013 1:51 AM
  • Seems like homework.

    Start to write the code yourself. Then, if you have questions we are there to help.

     

    Noam B.



    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...

    Monday, May 13, 2013 11:06 AM
  • Hi

      public interface IShape
        {
            double Volume();
            double Area();
        }
        class Circle : IShape
        {
            public int radius { get; set; }
            public double Volume()
            {
                return (4 / 3) * Math.PI * radius * radius * radius;
            }
    
            public double Area()
            {
    
                return Math.PI * radius * radius;
            }
        }

    Refer Article

    Regards

    Monday, May 13, 2013 11:15 AM
  • Hi Hemant jha

    If you want to be a professional programmer someday, you have to try do your homeworks yourself. You may get some help, but you really need to do it yourself. You may start, and much of people here are ready to help you. :)

    Monday, May 13, 2013 7:35 PM
  • You build form 1 with two buttons "Area for Circle" and "Volume for Cube" and link them to their respective forms.

    Then take text box(or whatever you may like) as user's entry field for radius and calculate the area of the respective figure.

    You can also do this in a single page taking the radius, and keeping two radio buttons for circle and for Cube, one button "Calculate" and another field to show result.


    Tuesday, May 14, 2013 1:33 AM
  • Bonnie, I'm not asking the original poster to contact me, I am asking John to contact me...  If it is homework then John does not exist.  If it is not homework then I will make sure that John from Mega Technologies posts any specific questions here, he may just need help in using the editor or creating an account on this site.

    Clever, Paul! ;0)


    ~~Bonnie Berent DeWitt [C# MVP]

    geek-goddess-bonnie.blogspot.com

    Thursday, May 16, 2013 4:59 AM
    Moderator