Welcome to Dream.In.Code
Become a Java Expert!

Join 149,935 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,471 people online right now. Registration is fast and FREE... Join Now!




Calculations using user input numbers

 
Reply to this topicStart new topic

Calculations using user input numbers

jlgraham
26 Jun, 2008 - 06:58 AM
Post #1

New D.I.C Head
*

Joined: 24 Jul, 2007
Posts: 5


My Contributions
Thanks for your help and I understand the reasoning but it still won't work. I have to store the result in an int variable and I get the error result already define in main double result = num3-num2;
I don't understand how to get the results to an int unless I can explicitly make it but how. More help please.
User is offlineProfile CardPM
+Quote Post

rgfirefly24
RE: Calculations Using User Input Numbers
26 Jun, 2008 - 08:07 AM
Post #2

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 335



Thanked: 5 times
Dream Kudos: 150
My Contributions
QUOTE(jlgraham @ 26 Jun, 2008 - 07:58 AM) *

Thanks for your help and I understand the reasoning but it still won't work. I have to store the result in an int variable and I get the error result already define in main double result = num3-num2;
I don't understand how to get the results to an int unless I can explicitly make it but how. More help please.



show us your code please and remember to use the code tages (the pound symbol on toolbar when you do a fulledit/new post)
User is offlineProfile CardPM
+Quote Post

Locke37
RE: Calculations Using User Input Numbers
26 Jun, 2008 - 10:23 AM
Post #3

Contributor of the Year
Group Icon

Joined: 20 Mar, 2008
Posts: 1,270



Thanked: 56 times
Dream Kudos: 325
My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
__________________________________________________________

Alrighty then, now that that's covered...

Theoretically, it sounds like you just need to change the name of the result variable. Are you doing this?

java
double result;

double result = num3 - num2;


Or are you doing this?

java
double result;

result = num3 - num2;


You only have to say double once.

This post has been edited by Locke37: 26 Jun, 2008 - 10:25 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 04:07PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month