![]() |
Help with Scientific Notation in Java
Hi, I am a college freshman and I am taking my very first Java programming class. I have never programmed before, so I am having a little bit of trouble. For our second lab, we are to put numbers into scientific notation using the mod (%) and printf operator. I am having trouble doing this, so could some body help me figue out what I need to do? Here is a copy of my code:
Code:
import java.util.Scanner; |
Code:
Java != JavaScript |
I'm not sure why you are using the modulus operator here at all. With a printf, you can simply use %e or %E to display as scientific notation. Although, with doubles of these magnitudes, they will likely all show up as notation in the print/println calls anyway.
|
| All times are GMT +1. The time now is 09:00 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.