/    Sign up×
Community /Pin to ProfileBookmark

I was wondering if anyone could give me a little hand here?

I’ve done this script that basically needs to prompt a student for their student number and student name, and to make sure the student number is between the range of 1 and 500 and if not, warn them that it is not in the correct range. The program would then display students username followed by a hyphen and then their student number (example: j-10292)

this is as far as i have got so far, however it doesnt seem to be loading in my browser and i cant understand why?:

[CODE]<!–
import java.awt.*;
import java.applet.Applet;

public class test extends Applet
{
public void Studentname()
{
var student_name;

student_name = window.prompt(“Please enter your student name”, “”);

var student_number;

student_number = window.prompt(“Please enter your student number”, “”);
student_number = Integer.parseInt(student_number);

if ((student_number =>500) ||(student_number =<0))
{
document.write(‘Please enter a number between the range of 1 and 500.’);
}
else
{
student_number = window.prompt(“Your Student Number is”, “” + student_number);
}
}
}
/–>[/CODE]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 04.2009 — Java or JavaScript?
Copy linkTweet thisAlerts:
@spireauthorFeb 04.2009 — sorry, this particular thing is javascript.
Copy linkTweet thisAlerts:
@FangFeb 04.2009 — document.write will write a new document if it is used after the document has loaded.

Use alert('foo') or write to an element; elm.innerHTML='foo';
×

Success!

Help @spire spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...