Computing.Net > Forums > Programming > programming for newbies

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

programming for newbies

Reply to Message Icon

Name: pod
Date: February 26, 2007 at 08:08:16 Pacific
OS: windows xp
CPU/Ram: 2gbs
Product: dell
Comment:

lads im a total newbie when it comes to java

how do i do a program like this
(1)Prompt the user to enter an integer

(2)Determine if the number is a prime number - A number is prime if it is not divisible by any positive integer other than 1 and itself; 1 is not considered to be a prime.. For example, 2, 5, 17, and 4,598,731 are primes, whereas 6 and 35 are not prime. A message should then be output stating whether the number is a prime number or not.

i think i got the first one right about integers

public class assignment
{
public static void main(String[]args)
{

System.out.println("Please input an
integer");
hope im right there

do i dont have a clue about the Determine if the number is a prime number - A number is prime etc



Sponsored Link
Ads by Google

Response Number 1
Name: KellieThiLe
Date: March 1, 2007 at 18:25:01 Pacific
Reply:

Hey!

For my Programming I class, we have to buy this book: http://www.amazon.com/Fundamentals-... In the book, as I read last night, it had the writtened program for getting the prime numbers and also alert user if they had input in the wrong integers!

You can buy this book :)
Or I'll try to take a closer look in the book for the writtened program for you. I can't do it now because I have a program to do.


-Kels

I'm only here to get help on programming and such ;


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: programming for newbies

c++ programming for novell www.computing.net/answers/programming/c-programming-for-novell/2525.html

looking for a program for inventory www.computing.net/answers/programming/looking-for-a-program-for-inventory/8785.html

VB.NET Programming for SQL Server www.computing.net/answers/programming/vbnet-programming-for-sql-server/8306.html