Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2522
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: Helpppp plzzz |
| Date | 2013-02-21 13:57 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <kg5ql0$7ih$1@dont-email.me> (permalink) |
| References | <6764b4a4-d242-410a-9a1e-603b0a7f5695@googlegroups.com> |
On 2/21/2013 1:30 PM, Sara M. wrote:
> [...]
> package mixedresults;
>
> /**
> *
> * @author •SaRa•
> */
> public class Tester {
>
> public static void main(String []args)
> {
> final double d1=37,9;
Did you mean `37.9' instead of `37,9'? Java follows the
American practice of using `.' instead of `,' between the
integer and fraction parts.
Once you fix that problem, though, there's more:
> double d1 = 37.9;
This defines a variable named `d1', but a `d1' variable
has already been defined -- You can't define a second `d1'
here. Either fix the first line and delete this one, or
delete the first line.
> double d2=1004,128;
Same `.' vs. `,' problem as before.
> int i1=12;
> int i2=18;
>
> Problem 1: 57.2*(i1/i2)+1;
> Problem 2: 57.2*((double)i1/i2)+1;
> Problem 3: 15-i1*(d1*3)+4;
> Problem 4: 15-i1*(int)(d1*3)+4;
> Problem 5: 15-i1*((int)dl*3)+4;
These five lines aren't Java; they're just copied from
the problem statement. Apparently the intent is for you to
write Java statements that perform these calculations (and
print the results, probably). If you run into trouble writing
those statements, post what you've tried along with any error
messages you get, and someone will try to help you.
> }
>
> }
>
--
Eric Sosman
esosman@comcast-dot-net.invalid
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Helpppp plzzz "Sara M." <kasra.song@gmail.com> - 2013-02-21 10:30 -0800
Re: Helpppp plzzz Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-02-21 13:57 -0500
Re: Helpppp plzzz Roedy Green <see_website@mindprod.com.invalid> - 2013-02-21 18:13 -0800
Re: Helpppp plzzz Lew <lewbloch@gmail.com> - 2013-02-21 18:31 -0800
Re: Helpppp plzzz Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-02-22 10:00 -0800
Re: Helpppp plzzz Roedy Green <see_website@mindprod.com.invalid> - 2013-02-24 00:17 -0800
csiph-web