Easy math problem...I suppose....

I am trying to make these calculations in a Java program, but they will not simply work.
I want to power a variable r(the radius of a sphere) with 2 and then 3.
v(volume), a(area) and r(radius) are all Integer.
What am I doing wrong?
v = (4*(Math.PI)*rE3)/3;
a = 4*Math.PI*rE2;
Many thanks
/Martin

rE2 - looks like you're assuming that means 'raise r to the 2nd power'. It doesn't (it just looks for a variable named 'rE2').
Use Math.pow(r, 2)

Similar Messages

  • Looking for an Alarm Clock app where you do math problems to turn it off

    Someone told me of an application for the iPhone that is an alarm clock in which you can use a mode that, when the alarm sounds, you need to solve a math problem or other visual test in order to cease the alarm. That way the user is more awake by the time the alarm is stopped. Sounds annoying, yes, but would be just what I need.
    Anyone know which alarm app this is? Or if it even exists?

    There's another app that got a lot of press recently called *Proactive Sleep*.
    It works similarly to the math app mentioned above but you do a 30 second visual game when you wake up. It also records your score as well as your sleep patterns and can give you recommendations and other feedback to improve your sleeping habits.

  • Getting the top left corner of a grid cell (math problem)

    I'm making a map editor for a tile based game. The editor makes a grid:
    private function drawGrid():void {
                var grid:Sprite = new Sprite();
                var tileSize:uint= 50;
                for(var i:int=0;i<row;i++)
                    grid.graphics.lineStyle(1,0x000000,0.3);
                    grid.graphics.moveTo(0, i*tileSize);
                    grid.graphics.lineTo(700, i*tileSize);
                for(var j:int=0;j<column;j++)
                    grid.graphics.lineStyle(1,0x000000,0.3);
                    grid.graphics.moveTo(j*tileSize, 0);
                    grid.graphics.lineTo(j*tileSize, 400);
                stage.addChild(grid);
    And when the user clicks anywhere in the screen a movieclip is added to stage. The movieclip (exported for actionscript as Tile) should be placed in the top left corner of the grid cell.
    private function placeTile(mouseX:int, mouseY:int, frame:uint):void {
                var tile:Tile = new Tile();
                tile.gotoAndStop(frame);
                tile.x = PROBLEM HERE
                tile.y = PROBLEM HERE
                stage.addChild(tile);
    How can I do that? I came up with an idea but it didn't work because I have a math problem.  Let's pretend that the user mouse is at position mouseX = 456:
    I could remove the hundreds and use the quotient 56 and check if it is above 50. If it is above 50 I would place it at x = 500 if not I would place it at x = 450. How can I remove the hundreds? Do you have a better idea?
    Message was edited by: wilsonsilva7 because unconsciously I pressed ctrl+s (to save) and the message was posted

    Thanks. I asked a friend and he told me about the %but I still had a problem. Your expression solved my problem
            private function placeTile(mouseX:int, mouseY:int, frame:uint):void {
                var tile:Tile = new Tile();
                tile.gotoAndStop(frame);
                tile.x = Math.floor(mouseX / tileSize) * tileSize;
                tile.y = Math.floor(mouseY / tileSize) * tileSize;
                stage.addChild(tile);
    That way every tile is centered every 50 pixels

  • Strange math-problem with LabVIEW 7.1

    Hello!
    I am using LabVIEW 7.1 and I came to this strange math-problem. Could it be that it is a problem of LabVIEW 7.1?
    Ok try this with LabVIEW 7.1:
    open a new VI
    place a subtract-VI (pallet numerical) on the block diagram and try to subtract 0.2 from 1.6
    place a less-VI (pallet compare) on the block diagram and wire a numerical constant 1.4 to input x
    wire the result of the subtraction to input y of the comparison
    place an LED to the output of the comparison
    and start this.
    What does it say?
    The LED should turn on and this means here that 1.4 would be less than 1.4 .
    But I would have expected that 1.4 is not less than 1.4 .
    This works also if you add or subtract upto 0.2 to/from the values 1.4 and 1.6 (or equivalent with 0.2) .
    If you change the inputs of the comparison then the result is as expected and 1.4 is reported not to be less than 1.4 .
    If you compare two constants with the same value 1.4 you will not get the same strange result.
    Does anybody have an explanation for this?
    Espelkamper

    Hello,
    For floating point math: Rounding to multiples of 0.1 is problematic as
    those numbers are infinite fractions in base2 representation...
    So maybe you should change your numbers to integers using fixed point math. If all your input values are in the range of 1.4 to 1.8 you can multiply by 10000 and round to next integer. Then do your comparison on that integer (there's also an 'InRange' function in the comparison palette).
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Re: Help needed for easy Math & Java problems

    The logic in pseudo code :
    IF length <= 1
    Price = Base price;//Base price = 8 in your case;
    ELSE IF length <= 10
    Price = Base price + (Extra Meter Price * (length - 1));
    ELSE IF length <= 20
    Price = (Base price + (Extra Meter Price * (length - 1))) * Discount1
    ELSE
    Price = (Base price + (Extra Meter Price * (length - 1))) * Discount2
    RETURN Price.
    Code it in Java then.
    Do not use magic numbers.

    The logic in pseudo code :
    IF length <= 1
    Price = Base price;//Base price = 8 in your case;
    ELSE IF length <= 10
    Price = Base price + (Extra Meter Price * (length - 1));
    ELSE IF length <= 20
    Price = (Base price + (Extra Meter Price * (length - 1))) * Discount1
    ELSE
    Price = (Base price + (Extra Meter Price * (length - 1))) * Discount2
    RETURN Price.
    Code it in Java then.
    Do not use magic numbers.

  • Maths Problem in Action Script 2.0

    Hi surfers,
    We have a problem in Action Script 2.0 to solve the maths equation given below:
    write a code in Action Script 2.0 to solve these two equation.
    Aim: To know the value of "a" in both different equations.
    1. 2a + 5 = 3a + 1
    2. 4a + 3 = 11
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    Hello, you are at the wrong forum. for AS 2.o questions, hop on there: http://forums.adobe.com/community/flash/flash_actionscript
    BTY, people answer when they can, not when you want...

  • Easy Transfer problems

    new Computer                       C:drive with win 7 is 40gb, 
    E:drive is 1tb
    old computer                         C:drive with win 7 is
    500gb, D:drive is 80gb
    I want to transfer the contents of my old computer (400gb) to the E:drive on the new computer but when using the easy transfer cable it will only transfer to the smaller C:drive HDD at 40gb
    on the new computer and wants me to discard files
    Have any solution to my problem?
    Do I rename the  C
    Regards
    Bill Anderson

    Hi Bill,
    First of all, I must to tell you, rename the C:\ cannot change its drive letter, just change its label. And I don't recommend you change the system drive letter, it would affect the system normal usage.
    Next let's go back to your problem.
    When you transfer files, the information on each drive on your old computer will be transferred to the respective drives on your new computer. Unless Windows Easy Transfer detects that the drive names on your old and new computers don't match. For example,
    if you choose to transfer files and settings from the C: and D: drives on your old computer, but your new computer only has a C: drive, then you will be asked to select which drive on your new computer you want to transfer information to.
    In addition, not all files could be moved, fore more information, please read this article:
    Transferring files and settings: frequently asked questions
    http://windows.microsoft.com/en-in/windows/transferring-files-settings-faq#1TC=windows-7
    Karen Hu
    TechNet Community Support

  • Logic for this math problem

    Before I get stinker replies for cross posting , let me tell that , i have been recommended to post this in this forum.
    My problem is such:
    I need to find a logic to implement the following :
    In the floating point number , say , 1.0.. the Integral part will remain constant(1) but the decimal part has to get incremented by 1
    1.1 +0.1
    1.2+0.1
    1.3+0.1
    1.4+0.1
    1.5 +0.1
    1.6+0.1
    1.7+0.1
    1.8+0.1
    1.9+0.1
    1.10+0.1
    1.2... But what I need here is 1.11 ,1.12
    I need my programming logic to detect there needs to be a change in the increment value from 0.1 to 0.01 when I reach 1.1
    and from 0.01 to 0.001 when i reach 1.111..so on,
    please suggest..

    you can't do it with a double,
    since double d = 1.10d; will be treated as 1.1d
    what you can do is treat the double as a String
    public void test(){
    String s1 = "1.9";
    String s2 = "1.10";
    String s3 = "1";
    String s4 = "1.1";
    System.out.println(increment(s1));
    System.out.println(increment(s2));
    System.out.println(increment(s3));
    System.out.println(increment(s4));
    public String increment(String d){
    int pos = d.indexOf(".");
    if (pos != -1){
    if (d.charAt(d.length()-1) == 0)
    return d.substring(0, d.length()-2) +
    ength()-2) + "1";
    String temp = d.substring(pos+1);
    int num = Integer.parseInt(temp);
    num++;
    return d.substring(0, pos+1) + num;
    else
    return d + ".1";
    }gives
    1.10
    1.11
    1.1
    1.2
    I leave it to you to understand the logic...it's to
    get you started..it does not check for all conditions
    of the inputI think it is a Math with algorithm problem. Your solution is good, but you are using String functions so much. There is other solution, handling with numbers only.

  • Easy DMS  - problem with  object linking (unicode client)

    Hi Gurus,
    I have a problem concerning linking a materialmaster to a DIR in a uniciode environment. I tested following scenarios:
    1) Easy DMS 6.00 SP10 non unicode  +  non unicode Backend  -->  no problem
    2) Easy DMS 6.00 SP10 non unicode  +  unicode Backend        -->  no problem
    3) Easy DMS 6.00 SP10 unicode        +  non unicode Backend  -->  no problem
    4) Easy DMS 6.00 SP10 unicode        +  unicode Backend         --> problem
    Following Problem appears in scenario 4:
    Our Material Number Format is ______-____-___ (6 digits - 4 digits - 3 digits), "Lexicographical" is disabled, "Leading Zeros" is enabled.
    When I type in material number "111111-2222-333" and press "check all objects and read description" Easy DMS reads the description for
    111111-2222-333 but after that easy dms changes 111111-2222-333 to 000001-1111-122 and when I try to save the DIR it tells me that 
    000001-1111-122 is not a valid material master.
    As I mentioned this only appears with the unicode client + unicode backend. Any Ideas?

    Hi David,
    please tell us which version of EasyDMS you use currently. If you do not use EasyDMS 6.00 SP10 I would kindly ask you to see SAP note 1105699 and download this SP from the Service Marketplace.
    Further please check if you have maintained the object link customizing correclty in your backend system. Therefore please see the information in the SDN WIKI area for DMS under https://www.sdn.sap.com/irj/sdn/wiki?path=/display/plm/ca-dms-Object+link
    Best regards,
    Christoph
    P.S.: Please reward points for useful information.

  • EASY DMS Problem 6.0 SP11 Patch01 (Unicode), display classification data

    hallo
    i have installed Easy DMS 6.0 SP11. In the search result, no classification data are shown. The problem doesn't exist in 6.0 SP03. Any idea?
    Regards
    Hans
    Edited by: Hans Koeniger on Feb 2, 2009 8:58 AM

    Problem seems to be solved, perhaps by transports in the backend.

  • How can I use superscript in math problems presented on Firefox

    Working in KahnAcademy.org, there are math videos to explain an issue and then trial problems to test learning. In the Pre-Algebra section there are some videos regarding logarithms, To write a logarithm one needs to write a number with its exponent. A 2 for squared, 3 for cubed etc. To write the exponent it should be in superscript.
    I need to be able to write the exponent wherever I write something when within Firefox.

    Sorry, Firefox for Android is not yet compatible with Adobe Flash Player. We've started work to add Flash support, and you can follow our progress on this page: https://wiki.mozilla.org/Fennec/Features/Plugins

  • Math Problem

    I need some help! I admit, I'm not a java guru...far from it, just a college student with a book that doesn't have many examples for what I'm looking for. Any help will be greatly appreciated!!!
    My problem: My java program is to find a root using the Newton-Rapson method. The input is a function, i.e. f(x) = x^2 + x + 2. The program is to prompt the user for the beginning numbers, i.e. 225 and -43, and then find the answer to the nearest hundredth.
    I can do this on paper - no problem, my problem is I don't know enough about Java to program it to do the math.
    Unfortunately, if there are any predefined classes or methods that will do this problem for me, I'm NOT allowed to use them. Every step has to be hard coded. :(
    I'm not sure how to get Java to recognize the + sign or
    the ^ sign or any other non-numeric signs. I know there is something called substring, but I can't seem to find examples where it uses an integer. All the examples I have found are chars (like reading the string "hello"). Not helpful when you are trying to mix integers with symbols.
    Any help offered would be greatly appreciated, and I'm sure would in-turn help me the the bisection algorithm and all the future algorithm's I have to put into a program.
    Thanks for your time.

    [mode=Pedantic] Its Newton-Raphson [mode]
    Anyway use this as a starting point, its from a guy by the name of Neil Broadbent (see: http://www.neiljohan.com/java/ for lots of java samples)
    This will calculate the square root of a number using Newton-Raphson factoring, you can use this as a starting point.
    //Program to calculate the square root of a number using the Newton-Raphson.
    //It stops when the difference between consecutive approximations is less than 0.00005
    //by Neil Broadbent
    import java.io.IOException;
    import NeilClass.*;
    public class NewtonRaphsonClass
         private static boolean debugging = true;
         /** @param tFactorial the value from which to find the square root
          *  precondition tFactorial>0
          *  @return x1 so that x1>0 */
        public static double iSquareRoot (double tFactorial) throws IOException
                double x1=0;
                double x0=tFactorial/2;
                double a=tFactorial;
                boolean finished=false;
         /* check pre-condition */
         if (debugging && (tFactorial<=0)){
              System.out.println("Pre-condition violoated");
              finished=true;
                while (finished==false)
                    x1=(x0+(a/x0))/2;
                    if (x1>x0){
                        if ((x1-x0)<0.00005){
                            finished=true;
                    else if (x0>x1){
                        if ((x0-x1)<0.00005){
                            finished=true;
                    x0=x1;
              /* check post-condition */
              if (debugging && (x1<=0)){
                   System.out.println("Post-condition violoated");
                return x1;
    }

  • Oracle net8 easy config Problem

    i am not able configure Oracle net8 easy config in oracle forms & Reports.When i click the Oracle net8 easy config shortcut,then the window is not shown .After that there is no action .i am using P4 1.7GHz with 128DDR RAM.
    How can i retrive this problem.
    Thanks
    Cyril

    You can modify script file "..\orant\NET80\ADMIN\tnsnames.ora"
    LOCAL.WORLD =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB Server name)(PORT = 1521))
    (CONNECT_DATA = (SID = ORCL))
    HAFEEZ

  • Probably a simple answer: easy div problem

    Hello,
    I have a very easy problem but can't find the answer.  3 divs: 1 "wrapper" and 2 inside it (one left column, one right).  I want to get the CSS settings so that the left and right column are both the same length.  Right now they are on auto length and the left column is longer.  I tried to "fill out" the wrapper with the right column by setting the right column to 100% length, but now I realize the "wrapper" div is being shrink-wrapped around the shorter right column and is not stretching it.  I just want both columns to be as long as the (longer) left column.
    Thanks!

    First of all height: 100% doesn't work for divs usually. The height of the browswer window is very hard to fiigure out.
    Second: http://matthewjamestaylor.com/blog/equal-height-columns-2-column.htm
    SOmehow that layout works, and I don't qutie know how although it is a very simple layout.
    Lastly,  I'll bust out the unorthodox, loathed answer that actually is fine unless you want to worry about various screen types or browsing devices: a table.
    First, I will say that it is great that there is new CSS that allows divs to display as tables as Murray, I think, is saying. But with 10% of peple still using IE 6 and 10% using IE 7 (crazy, eh?), I don't think you can do away with support from IE 7 yet, even though we're just about up to 10 now.
    Tables are the intuitive way to solve this if you are not concerned with separating content and organization, which good modern designers are usually concerned with:
    <table class="content">
    <tr>
    <td>first column</td>
    <td>second column</td>
    </tr>
    </table>
    No fuss no muss. But if we can figure out how the two even length columns layout works above, I'd say that's the smart, modern way to deal with this.

  • Creating a form with a field that contains a simple math problem.

    I am creating a form in Acrobat 9 Standard that contains a field that requires a simple math function (divide).
    if (QuantityRow1 > 0)
    ExtensionRow1 / QuantityRow1
    Take the value input in ExtensionRow1 and divide it by the value in QuantityRow1. I have included an IF statement to prevent an error that occur if QuantityRow1 were equal to zero.
    After inputting the data into the two fields I tab past the field where I expect to see my result and the field remains blank. I don't receive any error messages.
    Any ideas? Thanks - jb

    This is a duplicate of your question on Acrobatusers.com (
    http://answers.acrobatusers.com/Need-simple-math-operation-function-Acrobat-9-Standard-cre ating-form-q142800.aspx
    Did the information provided there not help you with your problem?
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com

Maybe you are looking for

  • Error while updating report attributes

    Hi, Iam getting following error "ORA-20001: Error in DML: p_rowid=181637527721463144, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "1D70D6

  • How do I make a partition on my HD to install Snow Leopard (Lion is on my HD now)?

    I have been an Apple fan since the first Mac in 1984 and have used every version of the OS since then.  Until Lion, I thought each was an improvement on the previous.  I have had so many random and annoying problems since installing Lion  on my (earl

  • How data  is replicated from SAP R/3 to SAP BW

    Hi,     I have to replicate datasource from SAP R/3 ECC 6.0 TO  SAP BW.   Please, help me in this regards Thks in advance - Mubeen.

  • LSMW field with 5 decimal points

    Hi All, I need to pass a field in the LSMW with 5 decimal points. we cannot pass the data type as "PAC5". can any one suggest how this can be done in LSMW. Also, I am passing the currency key as USDN in the LSMW using Idoc method. But it is taking on

  • Is it possible to trigger a popup from f:selectItem

    I have a use case, where I have a dropdown (selectOneChoice), which shows a list of existing oracle homes, and last label gives the user an option of 'create new location'. I tried something like below: <af:selectOneChoice id="ohSelector"> <f:selectI