Cheating In Math the Easy Way

Discussion in 'Programming General' started by Morphis, Aug 4, 2008.

Thread Status:
Not open for further replies.
Cheating In Math the Easy Way
  1. Unread #1 - Aug 4, 2008 at 12:10 PM
  2. Morphis
    Joined:
    Aug 2, 2008
    Posts:
    734
    Referrals:
    0
    Sythe Gold:
    0

    Morphis Apprentice
    Banned

    Cheating In Math the Easy Way

    Well this is for cheating in Algebra. This Pythagorean Theorem Solver will actually show you what to write down on your paper!!!

    PROGRAM DOWNLOAD LINK - http://rapidshare.com/files/125773594/Triangle.jar.html

    Code:
    import java.awt.*; 
    import javax.swing.*; 
    import java.awt.event.*; 
    
    public class Triangle extends JFrame implements ActionListener, 
        Runnable  { 
        Thread go; 
        JTextField asquared = new JTextField(3); 
    	JLabel plus = new JLabel(" + ");
    	JTextField bsquared = new JTextField(3);
    	JLabel equals = new JLabel(" = ");
    	JTextField csquared = new JTextField(3);
         JButton solve = new JButton("Solve");
    	 JButton clear = new JButton("Clear");
         ButtonGroup option = new ButtonGroup();
    	 JLabel checkbox = new JLabel("Which part of the triangle are you missing?");
    	 JCheckBox quickpick = new JCheckBox("Leg", false); 
         JCheckBox personal = new JCheckBox("Hypotenuse", true);
    	 JTextArea an = new JTextArea(8,30);
    	 
    
    	  boolean a = false;
    	  boolean b = false;
    	  boolean c = false;
    	  double valuea;
    	  double valueb;
    	  double valuec;
    	  int selected = 0;
    	  int whichone = 0;
         
    	  
        Triangle() { 
            super("Edward's Pathagorean Therom Solver"); 
             setSize(430, 200); 
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
             Container content = getContentPane(); 
             BorderLayout bord = new BorderLayout(); 
             content.setLayout(bord);
    		 	 an.setEditable(false); 
         an.setLineWrap(true); 
         JScrollPane textPane = new JScrollPane(an); 
    	    csquared.setEnabled(false);
    		asquared.addActionListener(this);
            bsquared.addActionListener(this);
            csquared.addActionListener(this); 
    		solve.addActionListener(this); 
            clear.addActionListener(this);		
    		 JPanel centerPanel = new JPanel();
             JPanel topPanel = new JPanel(); 
    		 JPanel bottomPanel = new JPanel();
    		 bottomPanel.add(checkbox);
    		 bottomPanel.add(quickpick);
    		 bottomPanel.add(personal);
    		centerPanel.add(an);
            topPanel.add(asquared);
    		topPanel.add(plus);
    		topPanel.add(bsquared);
    		topPanel.add(equals);
    		topPanel.add(csquared);
    		topPanel.add(solve);
    		topPanel.add(clear);
    	    asquared.setText("a²");
    	    bsquared.setText("b²");
    	    csquared.setText("c²");
    		quickpick.addActionListener(this);
    		personal.addActionListener(this);
    		option.add(quickpick);
    		option.add(personal);
            content.add(topPanel, BorderLayout.NORTH);  	
    		content.add(centerPanel, BorderLayout.CENTER);
    		content.add(bottomPanel, BorderLayout.SOUTH); 
            setVisible(true); 
         } 
     
        public void actionPerformed(ActionEvent evt) { 
             Object source = evt.getSource();
    		 
    		 
             if(source == quickpick) {
    		 bsquared.setEnabled(false);
    		 csquared.setEnabled(true);
    		 bsquared.setText("b²");
    		 selected += 1;
    		 }else if(source == personal) {
    		 bsquared.setEnabled(true);
    		 csquared.setEnabled(false);
    		 csquared.setText("c²");
    		 selected -= 1;
    		 }
    		 
    		 
            
             
    		
    		else if(source == solve) {
                    quickpick.setEnabled(false);
    				personal.setEnabled(false);
    		        solve.setEnabled(false);
    		        asquared.setEnabled(false);	
    		        bsquared.setEnabled(false);
    		        csquared.setEnabled(false);	
    		        if (go == null) { 
    		             go = new Thread(this); 
    		             go.start(); 	 
    					 
            }  
    		
        }else if(source == clear){
        go = null;
    	solve.setEnabled(true);
    	quickpick.setEnabled(true);
    	personal.setEnabled(true);
    	asquared.setEnabled(true);
    	asquared.setText("a²");
    	bsquared.setText("b²");
    	csquared.setText("c²");
    	an.setText(null);
    	a = false;
    	b = false;
    	c = false;
    		if(selected == 0){
    		csquared.setEnabled(false);
    		bsquared.setEnabled(true);
    		csquared.setText("c²");
    		        		}else if(selected == 1) {
    				bsquared.setEnabled(false);
    				csquared.setEnabled(true);
    				
    				}
    	   }
    }
    	
    	
    	
    	
    
    
       public void run() {
    if(selected == 0){
    double geta = Integer.parseInt(asquared.getText());
    double getb = Integer.parseInt(bsquared.getText());
    
    
    if(geta <= 0 || getb <= 0) {
    an.setText("You have entered either a negative number" + "\n" + "or 0 for one of the fields" + "\n" + "press clear and try again");
    		        solve.setEnabled(false);
    		        asquared.setEnabled(false);	
    		        bsquared.setEnabled(false);
    		        csquared.setEnabled(false);
    
    
    }else if(geta > 0 && getb > 0){
    double asquareit = geta * geta;
    double bsquareit = getb * getb;
    double combined = asquareit + bsquareit;
    double rooted = Math.sqrt(combined);
    an.setText("a² + b² = c² " + "\n" + geta +"² + " + getb + "² = c²" + "\n"  + asquareit + " + " + bsquareit + " = c²" +"\n" + combined + " = c²" + "   put square root sign over both numbers" +"\n" + rooted + " = c");
    }
    
    
    
    
    }
    
    
    
    
    
    else if(selected == 1){
    double geta = Integer.parseInt(asquared.getText());
    double getc = Integer.parseInt(csquared.getText());
    
    if(geta <= 0 || getc <= 0) {
    an.setText("You have entered either a negative number" + "\n" + "or 0 for one of the fields" + "\n" + "press clear and try again");
    		        solve.setEnabled(false);
    		        asquared.setEnabled(false);	
    		        bsquared.setEnabled(false);
    		        csquared.setEnabled(false);
    
    
    }
    else if(geta > 0 && getc > 0){
    double asquareit = geta * geta;
    double csquareit = getc * getc;
    double subtracted = csquareit - asquareit;
    double rooted = Math.sqrt(subtracted);
    an.setText("a² + b² = c²" +"\n" + geta + "² + b² = " + getc + "²" +"\n" + asquareit + " + b² = " + csquareit  + "\n" + csquareit + " - " + asquareit + " = b²" + "\n" + subtracted + " = b²" + "\n" + rooted + " = b");
    }
    }
    
         
    
        } 
    
    	
    	
    	
    	
          public static void main(String[] arguments) { 
          Triangle frame = new Triangle();
         } 
    	 
    	 
     }


    Now this program will solve the Arc Length of a circle, that is if you know the radius/diameter and the central angle or C.A.

    PROGRAM DOWNLOAD LINK - http://rapidshare.com/files/125773739/ArcSolver.jar.html]rapidshare link

    Code:
    import java.awt.*; 
    import javax.swing.*; 
    import java.awt.event.*; 
    
    public class ArcSolver extends JFrame implements ActionListener, 
        Runnable  { 
        Thread go; 
        JLabel central = new JLabel("Enter the Radius");
    	JLabel centralangle = new JLabel("Enter the C.A.");
    	JLabel know = new JLabel ("Do you know the Radius or Diameter of the circle?");
    	JLabel key = new JLabel ("Key  -    C.A. = Central Angle of the circle in degrees   NOTE: Replace 'Units' with the indicated measurement in your problem");
    	JLabel answer = new JLabel("The answer will be displayed here");
        JTextField centralangleinput = new JTextField(3); 
    	JTextField centralangle2 = new JTextField(3);
         JButton display = new JButton("Solve");
    	 JButton clear = new JButton("Clear");
         ButtonGroup option = new ButtonGroup(); 
         JCheckBox quickpick = new JCheckBox("Radius", true); 
          JCheckBox personal = new JCheckBox("Diameter", false);
    	  int longer = 0;
    	  double circumference;
    	  double cir2;
    	  double cir3;
    	  double cir4;
    	  double cir5 = 360;
    	  String measurement;
         
    	  
        ArcSolver() { 
            super("Edward's Arc Length Solver"); 
             setSize(730, 170); 
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
             Container content = getContentPane(); 
             BorderLayout bord = new BorderLayout(); 
    		 BorderLayout bord2 = new BorderLayout();
             content.setLayout(bord);
    		 clear.addActionListener(this);
            display.addActionListener(this);
            quickpick.addActionListener(this); 
    		personal.addActionListener(this); 
            centralangleinput.addActionListener(this);		
             JPanel topPanel = new JPanel(); 
    		 JPanel leftPanel = new JPanel();
    		 JPanel eddie = new JPanel();
    		 JPanel inside = new JPanel();
    		 JPanel inside2 = new JPanel();
    		 leftPanel.setLayout(bord2);
    		 //topPanel.setLayout(lay);
    		 //eddie.add(cool);
    		 eddie.add(key);
            topPanel.add(central);
            topPanel.add(centralangleinput); 
    		topPanel.add(centralangle); 
    		topPanel.add(centralangle2);
    		JPanel secondtop = new JPanel();
             topPanel.add(display); 
    		 topPanel.add(clear);
    		 inside.add(know);
    		 inside.add(quickpick);
    		 inside.add(personal);
    		 inside2.add(answer);
    		 option.add(quickpick); 
             option.add(personal);
    		 leftPanel.add(inside, BorderLayout.NORTH);
    		 leftPanel.add(inside2, BorderLayout.SOUTH);
            content.add(topPanel, BorderLayout.NORTH);  
            content.add(leftPanel, BorderLayout.CENTER);
            content.add(eddie, BorderLayout.SOUTH);		
            setVisible(true); 
         } 
     
        public void actionPerformed(ActionEvent evt) { 
             Object source = evt.getSource();
    		 if(source == personal){		 
             central.setText("Enter the Diameter");
    		 longer += 1;
    
            }else if(source == quickpick) {
            central.setText("Enter the Radius");
    		longer -= 1;
    
            }else if(source == display) {		
            display.setEnabled(false);
            centralangleinput.setEnabled(false);	
            centralangle2.setEnabled(false);
            personal.setEnabled(false);	
    		quickpick.setEnabled(false);
            if (go == null) { 
                 go = new Thread(this); 
                 go.start(); 	 
    			 
            }  
        }else if(source == clear){
        go = null;
    	personal.setEnabled(true);
    	quickpick.setEnabled(true);
    	display.setEnabled(true);
    	centralangleinput.setEnabled(true);	
        centralangle2.setEnabled(true);
    	centralangleinput.setText(null);
    	centralangle2.setText(null);
    	circumference = 0;
    	answer.setText("The answer will be displayed here");
    	if(longer == 0){
    		central.setText("Enter the Radius");
            		}else if(longer == 1) {
    				central.setText("Enter the Diameter");
    				}
    	
    	   }
    }
    	
    	
    	
    	
    	
    
       public void run() { 
                    int radiusin = Integer.parseInt(centralangleinput.getText());
    		int centralin = Integer.parseInt(centralangle2.getText());
                    if(centralin > 360 || centralin < 0) {
                    
                    centralangle2.setEnabled(false);
                    answer.setText("Please enter a valid Central Angle, remember this is from a circle so the most it can be is 360, press clear to try again");
    
                    }else
    		if(longer == 0){
    		circumference = radiusin * 2;
    		cir2 = circumference * Math.PI;
    		cir3 = cir2 * centralin;
    		cir4 = cir3 / cir5;
    		answer.setText("The Arc Length is " + cir4 + " Units");
                        
            		}else if(longer == 1) {
    				circumference = radiusin * Math.PI;
    				cir2 = circumference * centralin;
    				cir3 = cir2 / cir5;
    				answer.setText("The Arc Length is " + cir3 + "Units");
    				}
        } 
    
          public static void main(String[] arguments) { 
          ArcSolver frame = new ArcSolver();
         } 
     }
     
  3. Unread #2 - Aug 4, 2008 at 12:48 PM
  4. Xaranx
    Joined:
    Feb 1, 2008
    Posts:
    181
    Referrals:
    0
    Sythe Gold:
    0

    Xaranx Active Member
    Banned

    Cheating In Math the Easy Way

    wow nice. thanks for this!!
     
  5. Unread #3 - Aug 4, 2008 at 1:17 PM
  6. Morphis
    Joined:
    Aug 2, 2008
    Posts:
    734
    Referrals:
    0
    Sythe Gold:
    0

    Morphis Apprentice
    Banned

    Cheating In Math the Easy Way

    Yep even getting one person to use a program is always worth making it.
     
  7. Unread #4 - Aug 6, 2008 at 3:09 AM
  8. Evan_Duh2
    Joined:
    Jun 19, 2007
    Posts:
    958
    Referrals:
    1
    Sythe Gold:
    0

    Evan_Duh2 Apprentice
    Banned

    Cheating In Math the Easy Way

    Damn man thank you so much haha.
     
  9. Unread #5 - Aug 7, 2008 at 6:19 PM
  10. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Cheating In Math the Easy Way

    Ummmm, if you can't do this math you should be in first grade... D:
     
  11. Unread #6 - Aug 8, 2008 at 4:41 AM
  12. Putther
    Joined:
    May 5, 2007
    Posts:
    679
    Referrals:
    1
    Sythe Gold:
    0

    Putther Apprentice
    Banned

    Cheating In Math the Easy Way

    Yea, have fun using the program on a test :) We'll see who passes then.
     
  13. Unread #7 - Aug 8, 2008 at 4:55 AM
  14. Crayola Oblongata
    Joined:
    Feb 27, 2008
    Posts:
    2,247
    Referrals:
    4
    Sythe Gold:
    0

    Crayola Oblongata Grand Master
    Banned

    Cheating In Math the Easy Way

    You can't use a program in the middle of an exam?
    But good program anyway
     
  15. Unread #8 - Aug 8, 2008 at 5:27 AM
  16. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Cheating In Math the Easy Way

    This is probably the most basic math I have ever seen (other than simple addition and subtraction). Okay, that was exaggerated, but you get my point.

    Pythagoras' Theorum definitely isn't hard. Right now in my Year 9 class I am bored because everyone is struggling with Trigonometry, and I can complete the entire page of questions in a few minutes. Thank goodness I am elligable for Mathematics C next year, finally something that suits my level.

    It is decent for what it is, however you don't need a program to do such things. A scientific calculator program would be infinitely more useful.
     
  17. Unread #9 - Aug 8, 2008 at 8:17 PM
  18. Vic
    Joined:
    Apr 21, 2005
    Posts:
    1,607
    Referrals:
    7
    Sythe Gold:
    49
    Discord Unique ID:
    181751669820882944
    Discord Username:
    Vic
    Two Factor Authentication User Easter 2020 Sythe's 15th Anniversary <3 n4n0 Lawrence Extreme Homosex

    Vic Meow
    Highly Respected Retired Administrator

    Cheating In Math the Easy Way

    its that hard to write h^2 = a^2 + b^2?
     
  19. Unread #10 - Aug 8, 2008 at 9:53 PM
  20. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Cheating In Math the Easy Way

    or c^2 - b^2 = a^2

    D:
     
  21. Unread #11 - Aug 9, 2008 at 5:23 AM
  22. KingMage
    Joined:
    Aug 5, 2008
    Posts:
    125
    Referrals:
    0
    Sythe Gold:
    0

    KingMage Active Member
    Banned

    Cheating In Math the Easy Way

    Loll wdf
     
  23. Unread #12 - Aug 9, 2008 at 5:38 AM
  24. Sythe
    Joined:
    Apr 21, 2005
    Posts:
    8,072
    Referrals:
    468
    Sythe Gold:
    5,287
    Discord Unique ID:
    742989175824842802
    Discord Username:
    Sythe
    Dolan Duck Dolan Trump Supporting Business ???
    Poképedia
    Clefairy Jigglypuff
    Who did this to my freakin' car!
    Hell yeah boooi
    Tier 3 Prizebox Toast Wallet User
    I'm LAAAAAAAME Rust Player Mewtwo Mew Live Free or Die Poké Prizebox (42) Dat Boi

    Sythe Join our discord

    test

    Administrator Village Drunk

    Cheating In Math the Easy Way

    Haha wait until you get swamped by advanced calculus. You'll wish you were still bored in trig.
     
  25. Unread #13 - Aug 9, 2008 at 5:42 AM
  26. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Cheating In Math the Easy Way

    Oh, I quite like being challenged. If I didn't I'd be getting low grades like the rest of my class. ^_^
     
  27. Unread #14 - Aug 9, 2008 at 6:34 AM
  28. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Cheating In Math the Easy Way

    LOL, I am taking math online instead of through my school now, or I hope I am so I can fly through the info, so I am not bored.... And so i will have taken calc before 11th grade... o_O

    I was bored as shit last year and got an A- at the end of geometer, cuz i got 100s on every test and quiz, except the first one, but i never did homework... in math let me be challanged!!!
     
  29. Unread #15 - Aug 16, 2008 at 11:06 AM
  30. Chase Young
    Referrals:
    3

    Chase Young Guest

    Cheating In Math the Easy Way

    Thanks for this, should prove quite helpful =D
     
  31. Unread #16 - Aug 16, 2008 at 11:09 AM
  32. sookusu
    Joined:
    Aug 16, 2008
    Posts:
    77
    Referrals:
    0
    Sythe Gold:
    0

    sookusu Member
    Banned

    Cheating In Math the Easy Way

    noice lol :p
     
  33. Unread #17 - Aug 19, 2008 at 8:06 AM
  34. just un dude
    Joined:
    May 27, 2005
    Posts:
    5,331
    Referrals:
    5
    Sythe Gold:
    2

    just un dude Hero
    Do Not Trade

    Cheating In Math the Easy Way

    Good for educational purposes anyway, and did you make this yourself?
     
  35. Unread #18 - Aug 19, 2008 at 8:58 AM
  36. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Cheating In Math the Easy Way

    I would bet he did... Its not that hard... and if you can not do this easily you realy need to go back a few years in math. :/
     
  37. Unread #19 - Sep 14, 2008 at 11:31 AM
  38. FartKnocker
    Joined:
    Sep 3, 2007
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    5

    FartKnocker Forum Addict

    Cheating In Math the Easy Way

  39. Unread #20 - Oct 4, 2008 at 6:42 PM
  40. Delex
    Referrals:
    0

    Delex Guest

    Cheating In Math the Easy Way

    whats the point of going to a class if you are just going to cheat. Kind of a waste of time.
     
< Runescape Barbian Village AutoMiner made in C++ | I cant uninstall Java!! I cant play runescape!! >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site