• Post Reply Bookmark Topic Watch Topic
  • New Topic

Decimal Point Issue?  RSS feed

 
Mark Georgevich
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my code:


My answer is correct except Zybooks is putting the decimal point in the wrong place. Why is this?

✖   Testing with gasPressure = 100 gasMoles = 1 gasTemperature = 273


Expected output: Gas volume: 22.698481533 m^3
Your output:         Gas volume: 226984.81533 m^3    its wrong because my decimal point is not between the second 2 and the 6.

Tests aborted.




 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if you get a calculator and work out 100 x 273 x 8.3144621 what do you get?


Also note that you never use the "pressure" variable in your calculation for the gas volume.
Also check your calling method.  It doesn't affect the answer too much in this case because multiplication is associative, but I think you have switched the order of a couple of values.
 
Knute Snortum
Sheriff
Posts: 4284
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Re: your post.

Please always UseCodeTags (that's a link) when posting code.  I'll do it for you this time.
 
Mark Georgevich
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i will use code tags from now on.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!