Results 1 to 18 of 18
Thread: hi!..please help..
- 12-06-2011, 07:26 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
- 12-06-2011, 01:02 PM #2
Re: hi!..please help..
You could use an expression in an assignment statement to add and/or subtract. An expression is two operands with an operator between them and perhaps surrounded by ()s: 44+2 or 7-3how to add and subtract in java program
Post the code you are working on so we can see your problems.
Also post the full text of any error messages.
- 12-06-2011, 02:17 PM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: hi!..please help..
9 - 600 != 591
9 - 600 = -591.
- 12-06-2011, 04:43 PM #4
Re: hi!..please help..
@Tolls, I believe the OP wants to know how to make it so the smaller number is automatically subtracted from the larger. So if the two inputs were 9 and 600, the output would be 591.
@OP, if I assume correctly, you will need to get the two inputs. Then you will need to compare them in an if, ie:
Do you have any code to show us? That might help us clarify a little better.Java Code:if (a>b) {//Subtract b from a} else {//Subtract a from b}- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
- 12-06-2011, 05:37 PM #5
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Re: hi!..please help..
If that is what you want it may be helpful to just use an absolute value method. Check the Math class.
- 12-07-2011, 08:40 AM #6
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
Re: hi!..please help..
i dont have no codes to show you...because i'm a beginner and i need the full codes...can you help for this?... please help me..
- 12-07-2011, 08:42 AM #7
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
Re: hi!..please help..
I dont have codes to show you...because i'm a beginner and i need the full codes...can you help for this?... please help me..
- 12-07-2011, 09:43 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: hi!..please help..
No.
We don't do that sort of thing around here.
- 12-07-2011, 09:59 AM #9
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
Re: hi!..please help..
so what can i do for my problem..please help..
- 12-07-2011, 12:37 PM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: hi!..please help..
Write some code?
That tends to be how you learn.
- 12-07-2011, 12:38 PM #11
Re: hi!..please help..
What is the purpose of your request for help?
Do you want to learn how to program in java?
Or do you want some code you can hand in to your professor?
- 12-08-2011, 02:08 AM #12
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
Re: hi!..please help..
yes i want to learn about java program..my problems is i want to create an timecard in using java program and i don't know how i start..
- 12-08-2011, 02:18 AM #13
Re: hi!..please help..
I guess you should read some tutorials about how to program in java.
I don't have any links to really basic tutorials. Here are some I have:
The Java™ Tutorials
The Really Big Index
- 12-08-2011, 02:43 AM #14
- 12-08-2011, 02:47 AM #15
Re: hi!..please help..
I get the feeling this OP is trying to figure out how to write any program even the HelloWorld program.
- 12-08-2011, 03:06 AM #16
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Re: hi!..please help..
If it is HelloWorld, I'll gladly write it for him:
Java Code:public class Hello{ public static void main(String[] args){ System.out.println("Hello, World!"); } }
- 12-08-2011, 05:28 AM #17
Member
- Join Date
- Dec 2011
- Posts
- 6
- Rep Power
- 0
Re: hi!..please help..
can u help me for javascript?
- 12-08-2011, 01:18 PM #18


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks