Simple JS exercises - answers needed asap!!!

goldy300

New Member
Messages
33
Reaction score
0
Points
0
I'm in a rush and all I want is the basic code conforming to the required instructions. ASAP needed!! I know it's like asking for the answers without doing the research but by doing this I'm able to see, modify and understand it later on. But in the mean time, I need it now to pass an open book test tomorrow.

Theres three here:


1.[FONT=&quot] [/FONT]Wordcount

Create a web application that requests a word as input and displays the word followed by the number of letters in the word.

2.[FONT=&quot] [/FONT]POSITIVE NUMBERS

Create a web application that asks the user to enter positive numbers into the computer until the product of the numbers exceeds 400. The application should then display the product. Modify the application so that the limit(400) can be entered by the user.

3.[FONT=&quot] [/FONT]Sum 1000 numbers

Create a web application that will add up all whole numbers between 1 and 1000 and display the result.


I appreciate any help and thanx in advance.
 
Last edited:

xmakina

New Member
Messages
264
Reaction score
0
Points
0
Kid, this stuff is easy. If you've been lazy to the point of putting off your own homework that you'd need for a test until the day before, that's your fault.

Pull an all-nighter and do it yourself.
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
I know it's like asking for the answers without doing the research but by doing this I'm able to see, modify and understand it later on. But in the mean time, I need it now to pass an open book test tomorrow.
rofl.
Why not look in the book for the answers? It's open book, remember! :D
1.Wordcount

Create a web application that requests a word as input and displays the word followed by the number of letters in the word.
Code:
var word = window.prompt('What word do you have?','');
window.alert(word+' '+word.length);
2.POSITIVE NUMBERS

Create a web application that asks the user to enter positive numbers into the computer until the product of the numbers exceeds 400. The application should then display the product.
Code:
var total=0;
while (total < 400) {
total += parseFloat(window.prompt('Total is less than 400, please enter another number',''));
}
window.alert('Your total is '+total);
Modify the application so that the limit(400) can be entered by the user.
Code:
var limit = parseFloat(window.prompt('What is the maximum number allowed?',''));
var total=0;
while (total < limit) {
total += parseFloat(window.prompt('Total is less than '+limit+', please enter another number',''));
}
window.alert('Your total is '+total);
3.Sum 1000 numbers

Create a web application that will add up all whole numbers between 1 and 1000 and display the result.
Code:
var total = 0;
for (i=1;i<=1000;i++) {
total += i;
}
window.alert('Total: '+total);
 

goldy30

New Member
Messages
60
Reaction score
0
Points
0
Thanks man. I see how simple it is now. 2:30am here now and last night was an all nighter... I've done 20 of 29 js exercises and I've got so much other stuff I'm trying to do.

Appreciated!!
 
Top