Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-22-2007, 05:47 PM   #1
Member (8 bit)
 
Join Date: Apr 2006
Posts: 131
tips for beginner java script learner

Hello,

I'm recently learning computer science in school and I am learning how to create some scripts. I'm having trouble in creating some type of script and I was wondering if someone could help me out on it. I'm not asking for you guys to write the whole script for me but some tips on what I should look for, etc. I know most of the terminology.

scripts with problems:

1) Write a program that calculates n!

2)Write a program that determines whether a given natural number is prime or composite.

3)Write a program with three integer variables, n1, n2, and n3. Initialize two of those variables, i.e. n1 and n2, with input from the user. Then swap the values of these two variables so that the value that was originally in n1 winds up in n2 and the value that was originally in n2 winds up in n1. Note: The third variable plays an important role. If you are having trouble, first try the next problem below involving the two balls and the three boxes.

4)Write a program that finds n! (wondering if this is the same as #1.)

Thanks Alot. I appreciate the help.
homi1ife is offline   Reply With Quote
Old 03-25-2007, 10:17 PM   #2
Member (5 bit)
 
RyanRyan52's Avatar
 
Join Date: Mar 2007
Location: Oregon
Posts: 21
All i know is the answer to the first one and the third:

1. You could do a loop that when n>0 will multiply n by b (another variable initialized to 1) then it will subtract 1 from n and repeat
ounce the loop is done it will output b

3. To do that you would put the value of n1 into n3, then n2 into n1, then n3 into n2

I hope you figure them out,
Ryan

PS 4 is the same as 1 unless you mean it does the factorial backwords
If that is what you mean, I can't explain it w/out writing the script
RyanRyan52 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java script, flash player will not play paydaymom Internet, Web Applications, & The Cloud 3 03-15-2007 06:31 PM
Java script works but java applets won't lexi Windows Legacy Support (XP and earlier) 13 09-14-2003 07:11 AM
Looking for a java script Eaglefeather Internet, Web Applications, & The Cloud 13 01-16-2003 10:40 PM
Losing Java Script while editing a web page in Word Wanabe Web Design / Development 5 12-17-2001 02:15 PM
how to turn off Java script in IE5 Bobz Internet, Web Applications, & The Cloud 1 12-15-2001 07:01 PM


All times are GMT -5. The time now is 07:26 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2