+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: cegonsoft.net | Advance Math in C# .net

  1. #1

    Default cegonsoft.net | Advance Math in C# .net

    In the past, every language has had its own set of keywords for common math operations such
    as rounding and trigonometry. In .NET languages, many of these keywords remain. However,
    you can also use a centralized Math class that’s part of the .NET Framework. This has the
    pleasant side effect of ensuring that the code you use to perform mathematical operations
    can easily be translated into equivalent statements in any .NET language with minimal fuss.
    To use the math operations, you invoke the methods of the System.Math class. These
    methods are static, which means they are always available and ready to use.

    The following code shows some sample calculations that you can perform with the Math class:

    double myValue;
    myValue = Math.Sqrt(81); // myValue = 9.0
    myValue = Math.Round(42.889, 2); // myValue = 42.89
    myValue = Math.Abs(-10); // myValue = 10.0
    myValue = Math.Log(24.212); // myValue = 3.18.. (and so on)
    myValue = Math.PI; // myValue = 3.14.. (and so on)


    The features of the Math class are too numerous to list here in their entirety. The previous
    examples show some common numeric operations.

    Visit: Cegonsoft

  2. #2

    Default

    Do math function in C#.
    If I'm off base, please feel free to let me know.

    The point is to set right variables type.

    double x = 25;
    double y = 225;
    double result = (x / y)*100;
    Response.Write(result.ToString() + "%");


    Since simple calculation doesn't need to using math class, you can do it
    directly in your code.

    Cegonsoft

  3. #3

    Default

    Software testing is for the checking the detect faults.
    Through the software testing establish confidence in software and evaluate properties of software
    Reliability
    Performance
    Memory Usage
    Security
    Usability

    So the software testing is the very important one work in the project development.
    Through which only we provide the very good quality product to clients and satisfies the client needs.

    In cegonsoft they provide very good training for the software testing.They provide the training in all the advance tools.
    So which the students get the good opportunity in the industry to get placement.

    Cegonsoft

  4. #4

    Default cegonsoft.net | Advance Math in C# .net

    public static class Math
    System.Math

    [Visual Basic]
    NotInheritable Public Class Math
    [C#]
    public sealed class Math
    [C++]
    public __gc __sealed class Math
    [JScript]
    public class Math
    [C#]
    /// <summary>
    /// The following class represents simple functionallity of the Trapezoid
    /// </summary>
    class MathTrapezoidSample
    {
    private double m_longBase;
    private double m_shortBase;
    private double m_leftLeg;
    private double m_rightLeg;

    public MathTrapezoidSample(double longbase, double shortbase, double leftLeg, double rightLeg)
    {
    m_longBase = Math.Abs(longbase);
    m_shortBase = Math.Abs(shortbase);
    m_leftLeg = Math.Abs(leftLeg);
    m_rightLeg = Math.Abs(rightLeg);
    }

    private double GetRightSmallBase()
    {
    return (Math.Pow(m_rightLeg,2.0) - Math.Pow(m_leftLeg,2.0) + Math.Pow(m_longBase,2.0) + Math.Pow(m_shortBase,2.0) - 2* m_shortBase * m_longBase)/ (2*(m_longBase - m_shortBase));
    }

    public double GetHeight()
    {
    double x = GetRightSmallBase();
    return Math.Sqrt(Math.Pow(m_rightLeg,2.0) - Math.Pow(x,2.0));
    }

    public double GetSquare()
    {
    return GetHeight() * m_longBase / 2.0;
    }

    public double GetLeftBaseRadianAngle()
    {
    double sinX = GetHeight()/m_leftLeg;
    return Math.Round(Math.Asin(sinX),2);
    }

    public double GetRightBaseRadianAngle()
    {
    double x = GetRightSmallBase();
    double cosX = (Math.Pow(m_rightLeg,2.0) + Math.Pow(x,2.0) - Math.Pow(GetHeight(),2.0))/(2*x*m_rightLeg);
    return Math.Round(Math.Acos(cosX),2);
    }

    public double GetLeftBaseDegreeAngle()
    {
    double x = GetLeftBaseRadianAngle() * 180/ Math.PI;
    return Math.Round(x,2);
    }

    public double GetRightBaseDegreeAngle()
    {
    double x = GetRightBaseRadianAngle() * 180/ Math.PI;
    return Math.Round(x,2);
    }

    static void Main(string[] args)
    {
    MathTrapezoidSample trpz = new MathTrapezoidSample(20.0, 10.0, 8.0, 6.0);
    Console.WriteLine("The trpezoid's bases are 20.0 and 10.0, the trapezoid's legs are 8.0 and 6.0");
    double h = trpz.GetHeight();
    Console.WriteLine("Trapezoid height is: " + h.ToString());
    double dxR = trpz.GetLeftBaseRadianAngle();
    Console.WriteLine("Trapezoid left base angle is: " + dxR.ToString() + " Radians");
    double dyR = trpz.GetRightBaseRadianAngle();
    Console.WriteLine("Trapezoid right base angle is: " + dyR.ToString() + " Radians");
    double dxD = trpz.GetLeftBaseDegreeAngle();
    Console.WriteLine("Trapezoid left base angle is: " + dxD.ToString() + " Degrees");
    double dyD = trpz.GetRightBaseDegreeAngle();
    Console.WriteLine("Trapezoid left base angle is: " + dyD.ToString() + " Degrees");
    }
    }
    cegonsoft

  5. #5

    Default

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private string ProcessName(string name)
    {
    var sb = new StringBuilder( name.Trim( ) );

    sb[ 0 ] = Char.ToUpper( sb[ 0 ] );

    var makeUpper = false;

    for( var index = 1; index < sb.Length; index++ )
    {
    if( Char.IsSeparator( sb[ index ] ) )
    {
    makeUpper = true;
    continue;
    }

    sb[ index ] = makeUpper ? Char.ToUpper( sb[ index ] ) : sb[ index ];

    makeUpper = false;
    }

    return sb.ToString( );
    }

    private void buttonProcess_Click(object sender, EventArgs e)
    {
    listBoxOutput.Items.Clear( );

    listBoxOutput.Items.Add( String.Format( "{0} your birthday", ProcessName( textBoxName.Text ) ) );

    var birthDate = DateTime.Parse( maskedTextBoxBirthDate.Text );


    // compute the age
    var now = DateTime.Now;

    // get the number of years
    var age = now.Year - birthDate.Year;

    // No birthday yet? Subtract a year
    if( now.Month < birthDate.Month || ( birthDate.Month == now.Month && now.Day < birthDate.Day ) )
    {
    age -= 1;
    }

    listBoxOutput.Items.Add(String.Format("is {0}.", birthDate.ToLongDateString( ) ) );

    listBoxOutput.Items.Add(String.Format("You are {0} years old.", age ) );
    }

    private void textBoxName_TextChanged(object sender, EventArgs e)
    {
    buttonProcess.Enabled = IsValid( );
    }

    private void maskedTextBoxBirthDate_TextChanged(object sender, EventArgs e)
    {
    buttonProcess.Enabled = IsValid();
    }

    private bool IsValid()
    {
    if ( String.IsNullOrEmpty( textBoxName.Text ) ) return false;

    var components = textBoxName.Text.Split(new[] { ' ' } );

    if (components.Length < 2 || String.IsNullOrEmpty( components[0] ) || String.IsNullOrEmpty( components[ 1 ] ) ) return false;

    try
    {
    var dt = DateTime.Parse( maskedTextBoxBirthDate.Text );
    }
    catch ( Exception )
    {
    return false;
    }

    return true;


    }
    }
    }

    cegonsoft

  6. #6

    Default

    Hi,
    Cegonsoft is the best IT Training Centre providing training on various technologies including .NET in Karnataka and Tamilnadu.

    Their comprehensive .NET course provides in-depth coverage of all .NET features from fundamental to advanced topics.
    They also provide Placement Assistance for their trainees and International Certification after completion of Course.


    Cegonsoft

  7. #7

    Default

    Nice math operation programs
    Cegonsoft

  8. #8

    Default

    DOTNET
    Dot Net is a software-frame work was made by Microsoft Corporation to get rid of the problems of COM, COM+ and DOM which is used to make re-usability of softwares.
    In Microsoft view: Dot Net is the Web services strategy to connect information, people, systems, and devices through software.
     Dot Net frame can support many languages.
     It allows interoperability (Each language which is used in the framework can access of other language codes).
     Dot Net provides tools and libraries that enable developers to create Windows software much faster and easier.
     It provides to build, deploy, manage and use connected with quickly manner.
     Also provides secure enhanced solutions with the Web services.
     Dot Net frame work is very easy to use with the intellisense.
     It comprises with the four major Components.
    They are:

     Common Language Specification (CLS).
     Framework Class Library (FCL).
     Common Language Runtime (CLR).
     Dot Net Tools.
    Main Benefits of the Dot Net are:
    It helps to make software better, faster, cheaper, and more secure.

    cegonsoft

  9. #9
    Emerald Star member madhusundar is on a distinguished road
    Join Date
    Sep 2011
    Posts
    104

    Default .NET frameworks and Training in CEGONOSOFT

    ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.

    ASP.NET is a Microsoft Technology
    ASP stands for Active Server Pages
    ASP.NET is a program that runs inside IIS
    IIS (Internet Information Services) is Microsoft's Internet server
    IIS comes as a free component with Windows servers
    IIS is also a part of Windows 2000 and XP Professional


    The .NET Framework is the infrastructure for the Microsoft .NET platform.

    The .NET Framework is an environment for building, deploying, and running Web applications and Web Services.

    TRAINING IN CEGONSOFT

    Python in Cegonosft
    CEGONSOFT is one of the country's fastest growing Information Technology Solution Company. CEGONSOFT has established itself with three independent successful divisions.

    Software Training
    Software Development
    HR Consultancy
    Providing International Certifications after the course and job assistance will be done through the HR.

    CEGONSOFT

  10. #10
    Emerald Star member madhusundar is on a distinguished road
    Join Date
    Sep 2011
    Posts
    104

    Default C# and dot net training in CEGONSOFT

    C# is Microsoft's new programming language for the .NET platform.
    It combines some of the best features of modern programming languages such as Java, C++ or Visual Basic.
    C# is an object-oriented language with single inheritance but multiple interfaces per class.
    It supports component-based programming by properties (smart fields), events and delegates (enhanced function pointers).
    C# is fully interoperable with other .NET languages such as VB.NET, Eiffel.NET or Oberon.NET.


    CEGONSOFT is one of the country's fastest growing Information Technology Solution Company. CEGONSOFT has established itself with three independent successful divisions.

    Software Training
    Software Development
    HR Consultancy
    Providing International Certifications after the course and job assistance will be done through the HR.
    CEGONSOFT

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts