Orange Posted January 27, 2017 Posted January 27, 2017 Ok so I'm basically done with my project, and I am given several different numbers to input to test it. When I type in 1 for the x,y, and z values I get the correct answer, but if I type in 2, 3, etc I get the wrong answer (I checked with a calculator). So I assume somewhere I typed my equation wrong or perhaps its executing in the wrong order. This is the equation that I must use: http://prntscr.com/e18inb This is my code for the project, and the equation is on lines 20 & 38 (at the bottom is where I run the program with the 2 for x,y,z the answer should be around 7.8 but I get -94): http://prntscr.com/e18jtg Thanks for the help
Mumble Posted January 27, 2017 Posted January 27, 2017 Maybe just order of operations on line 20 at the end of it you do / x * y * z The computer sees this as (NUMBER/x)*y*z so maybe try to add paranthesis 1
Orange Posted January 27, 2017 Author Posted January 27, 2017 4 minutes ago, Mumble said: Maybe just order of operations on line 20 at the end of it you do / x * y * z The computer sees this as (NUMBER/x)*y*z so maybe try to add paranthesis Thanks so much !!! I feel like a noob for not thinking about this, I've spent hours over this past week trying to figure out what I did wrong in the equation and it never occured to me to put () around the xyz part , thanks man I owe you one 1