Results 1 to 5 of 5

Thread: Help me fast!

  1. #1
    Manikyr is offline Member
    Join Date
    Jan 2009
    Posts
    17
    Rep Power
    0

    Default Help me fast!

    I donīt have any trouble with my code, I just have to change it so it counts the data from a cylinder.

    Java Code:
    import java.util.Scanner;
    import javax.swing.JOptionPane;
    
    public class Prov1a {
        public static void main (String[] arg) {
            Cirkel c1 = new Cirkel(),
                   c2 = new Cirkel();
            String s = JOptionPane.showInputDialog
                                    ("The first circles radius?"); 
            Scanner sc = new Scanner(s);
            double r1 = sc.nextDouble();
            if (r1 >= 0)
                c1.radie = r1;
            else {
                JOptionPane.showMessageDialog(null, "Error!");
                System.exit(1);
            }
            s = JOptionPane.showInputDialog("The second circles radius?");
            sc = new Scanner(s);
            double r2 = sc.nextDouble();
            if (r2 >= 0)
                c2.radie = r2;
            else {
                JOptionPane.showMessageDialog(null, "Error!");
                System.exit(1);
            }
            double a1 = Math.PI * c1.radie*c1.radie;
            double a2 = Math.PI * c2.radie*c2.radie;
            double o1 = 2 * Math.PI * c1.radie;
            double o2 = 2 * Math.PI * c2.radie;
            JOptionPane.showMessageDialog(null, String.format
                                            ("The first circles area  %.3f " +
                                            "and circumference %.3f\n" +
                                            "The second circles area %.3f " +
                                            "and circumference %.3f", a1, o1, a2, o2));
            System.exit(0);
        } // main
    }
    Last edited by Manikyr; 03-16-2009 at 12:52 AM. Reason: No reason

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    9

    Default

    usually asking for "help me fast" on this forum has an adverse affect. it would also help if you include more info about your code: what it does, what problems you are having, etc...
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    28

    Default

    I just have to change it so it counts the data from a cylinder.
    well, what have you done so far?

    and thanks for never replying to your previous post http://www.java-forums.org/new-java/16454-cylinder.html. It does make one wonder if you are going to respond to this one, and if not, why bother helping. Just a thought.

  4. #4
    splitline is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Default

    I"m not sure what your asking for? Counting data from the cylinder..

    Can you please give a little more info about the problem your having.

    Thanks

  5. #5
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

Similar Threads

  1. HELP FAST!!----Interest Calculator
    By Coop33 in forum New To Java
    Replies: 8
    Last Post: 10-15-2008, 01:44 PM
  2. pls help me fast!
    By rexson98 in forum New To Java
    Replies: 10
    Last Post: 10-15-2008, 12:20 PM
  3. JAVA Fast Track Course
    By fortius_computers in forum Reviews / Advertising
    Replies: 0
    Last Post: 08-30-2008, 09:55 AM
  4. Girl from Sweden needs help fast!!! :):)
    By charlotte in forum New To Java
    Replies: 0
    Last Post: 05-25-2008, 03:51 PM
  5. Fast Data Transfer 0.6.4
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-20-2007, 08:55 AM

Posting Permissions

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