Thread: Please help me with this problem

1. Member
Join Date
Mar 2011
Posts
4
Rep Power
0

Please help me with this problem

Question Number 1

Write a java application that display and sums up all the even numbers from 1-20.

Sample Output:
Even numbers are
2 4 6 8 10 12 14 16 18 20 = the sum of all numbers is 110

Question Number 2

Using while loop display the multiplication table.

1 2 3 4 - 10
2 4 6 8 - 20
10 20 30 40 - 100

Please help me !
I really need an answer as soon as possible !

Thanks :)

2. Senior Member
Join Date
Mar 2011
Posts
103
Rep Power
0
Have you attempted to work this out on your own? Are you stuck on a particular concept or do you have no idea where to start?

3. Member
Join Date
Mar 2011
Posts
4
Rep Power
0
I just don't know how to WRITE this JAVA APPLICATION.

Its my assignment in school then i did absent for one day.
Then my instructor give me that ASSIGNMENT . :(

Please help!

4. Member
Join Date
Mar 2011
Posts
4
Rep Power
0
can you give me a sample sir!

in using JAVA NETBEANS!

5. Senior Member
Join Date
Mar 2011
Posts
103
Rep Power
0
The thing is, we're not here to do your homework. I suggest you do the following:

1. Read your textbook and try to create a very simple Java program. There may even be a simple "Hello World" program for you to try.
2. In that program, you will probably have a main() method. You can add your own code to that main() method. That's where you can add your statements.
3. For Question 1, you can use a for loop to iterate through all of the numbers from 1-20. To determine if a number is even, use the modulus(%) operator. For example 8 % 2 will return 0. That means 8 is an even number.
4. Once you have determined that a number is even, add it to your running total.
5. When the for loop ends, display your running total.

After you get through Question 1, you will be better prepared to tackle Question 2.

6. Lets not spoonfeed him such simple code.

@op: we try not to give you code, you won't learn that way.

This is pretty easy(and logical)

Just google how loops work and then think how you would do this by hand and you can easily figure it out.

7. Member
Join Date
Mar 2011
Posts
4
Rep Power
0
Please sir !

Help me! i really need it now :)

next time i'll google for it!

8. Moderator
Join Date
Apr 2009
Posts
13,315
Rep Power
23
Originally Posted by Prokopyo
Please sir !

Help me! i really need it now :)

next time i'll google for it!
You have been told.
This is not a code factory.

9. No, I will not give you this code, this will take you maybe 5 minutes of thinking.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•