I need help with my javascript, please !

  • harry_100486
  • Born
  • Born
  • harry_100486
  • Posts: 1

Post 3+ Months Ago

Please help me people !

I need to write a javascript prog to analyse a number entered by the user to tell them whether a number is a prime
number or not (feature 1), and to generate a list of prime numbers between an upper and a lower integer number,
where the upper and lower limits are numbers entered by the user (feature 2).

now (A prime number is a round integer number that is only exactly divisible by itself or 1. For
example, 7 and 11 are prime. 8 is not prime as it is exactly divisible by 4 and 2 as well as
1 and 8.)

is there anyway that you will use repetition, using FOR, WHILE and DO WHILE loops.?? and if you use then please tell me where you are going to use and how

on the other hand, requirements which I will need from this prog are very clear:
1- The two features are incorporated into a single program, and the user needs to be
able to select which of the two features is required.
2- For feature 1, the user needs to enter a single candidate number. The number
entered is only valid if it is a round integer number and greater than 1.
3- For feature 2, the user needs to enter both lower and upper bound numbers. The
numbers entered are only valid if they are round integer numbers and greater than
1. The lower number must have a lower value than the upper number.
4- A prime number is only exactly divisible by itself and 1.
5- Number 1 is not usually considered prime.
6- Number 2 is considered prime.
7- All even numbers, except 2, are not prime as they are divisible exactly by 2. So 4,
6, 8 etc are not prime.
8- For feature 1, once the tool has decided whether or not a number is prime, a
message needs to be displayed to the user in the form “X is prime” or “X is not
9- For feature 2, a list of the relevant prime numbers (if any) need to be displayed to
the user in the form “X is prime”.
10- The tool should run as quickly as possible

now the prog should meet other stuff please:
1- Variable names should be appropriately chosen to reflect their purpose
2- Good use should be made of comments. Remember, other people may read your
code and they don’t know what was going on in your head when you wrote the
program. So make it easy for them to understand.
3- The design should be simple and logical, and not more complicated than it needs
to be.
4- You should have tested your software to make sure it does not have any bugs.
5- You should think about whether your code could make god use of ideas like
Javascript functions to make its function more obvious.
6- The program should be the result of your design. Remember the purpose of design
is to ensure that you build a good program. Design comes first, coding later.

Please do not try to produce a sophisticated user interface, because I just want a simple javascript prog,

PLease please help me with the flowchart as well, A flowchart OR pseudocode design for your program. You may find it easier to go with a flowchart design. You can do this either on paper, but you may find it easier to use a program to do this. There are many possible programs you could

and A completed testing schedule for your program to demonstrate that it works properly.

I will be thankful and greatful to this forum for the rest of my life as this is really important for me,

Please help me
  • spork
  • Brewmaster
  • Silver Member
  • spork
  • Posts: 6296
  • Loc: Seattle, WA

Post 3+ Months Ago

What do you have so far? We're not doing your homework for you. If you're stuck on a specific error or problem, let us know.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 38 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.