Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com question on For Loop Formula?

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 08-18-2002, 01:36 AM PM User | #1 victory1 New Coder   Join Date: Aug 2002 Location: Atlanta Posts: 26 Thanks: 2 Thanked 0 Times in 0 Posts Urgently seeking help on For Loop for Exam!!! I need help calculating the average for a Practical Exam 1) the teacher asked us to create a for loop and prompt the user to enter 10 numerical grade. (which I did) 2) She wants us to find the average of the user's 10 entry, and give them their final grades (ex: user enters 80, 90, 70, 90 etc.., the counter will stop prompting for entry after the 10th entry) I need to display, your final grade for the class 85, you've got a B) I need help figuring out the average formula! Please, i need to e-mail the teacher my practical by 10 PM (eastern time). Thank you, victory1 Last edited by victory1; 08-18-2002 at 01:43 AM..
 08-18-2002, 02:20 AM PM User | #2 beetle Senior Coder   Join Date: Aug 2002 Posts: 3,467 Thanks: 0 Thanked 0 Times in 0 Posts Code: `````` Last edited by beetle; 08-18-2002 at 02:30 AM..
 08-18-2002, 03:45 AM PM User | #3 victory1 New Coder   Join Date: Aug 2002 Location: Atlanta Posts: 26 Thanks: 2 Thanked 0 Times in 0 Posts It worked!!! Thank you, Thank you!!!!
 08-18-2002, 05:47 PM PM User | #4 brothercake Senior Coder   Join Date: Jun 2002 Location: near Oswestry Posts: 4,508 Thanks: 0 Thanked 0 Times in 0 Posts This forum is an excellent place to ask for help with school assignments, but I would discourage other members from just giving the answer. What's the point of that?
 08-18-2002, 06:04 PM PM User | #5 beetle Senior Coder   Join Date: Aug 2002 Posts: 3,467 Thanks: 0 Thanked 0 Times in 0 Posts Apologies if anyone disagrees with what I've done. I prefer to 'teach' in the same way that I learn best. I provided this code sample not so victory1 could 'hand it in' but learn from the structure I used and apply it to his/her own code.
 08-18-2002, 06:31 PM PM User | #6 jkd Senior Coder     Join Date: May 2002 Location: metro DC Posts: 3,163 Thanks: 1 Thanked 18 Times in 18 Posts See http://www.codingforums.com/showthre...&threadid=2090 I decided a clarification on homework issues was needed, so hopefully this situation won't occur again. __________________ jasonkarldavis.com
 08-18-2002, 08:04 PM PM User | #7 victory1 New Coder   Join Date: Aug 2002 Location: Atlanta Posts: 26 Thanks: 2 Thanked 0 Times in 0 Posts Thanks again beetle, you did nothing wrong and I really appreciate the help! Brothercake, Beetle explanation would not have made any sense without the complete format, and for your information, I did not copy his work! I simply look at his format, and realized how he arrived at the answer. I already had the work, i just could not get my average formula to work. My program was simply taking the last entry and dividing it by 10 and in turn, giving every one an 'F'. Thanks again, Beetle, this program was 1 of 4 we had to turn in, and asking the board for help was a last minute desperation, since i've been playing with the formula for at least 4 hours.
 08-21-2002, 01:41 PM PM User | #8 brothercake Senior Coder   Join Date: Jun 2002 Location: near Oswestry Posts: 4,508 Thanks: 0 Thanked 0 Times in 0 Posts No I'm sure you didn't. It's cool; I just felt the need to mention it.
 08-21-2002, 02:48 PM PM User | #9 RadarBob Regular Coder   Join Date: Jun 2002 Location: Round Rock, Texas Posts: 443 Thanks: 0 Thanked 0 Times in 0 Posts Since we're all in the learning mode here... Hay, V1 here's a suggestion for that most excellent code provided by beetle... Make the code more bullet proof by forcing a valid entry. As it stands the user could enter "z" for example. In the "prompt user for grades" part here's what you do. 1. prompt user for grade 2. begin a loop that checks for a valid entry 2a. if the entry isn't valid put out a message. 2c. prompt user for grade 2b. loop If the above must be repeated xx times wrap all the above in that existing FOR loop. Maybe too late for this assignment, but this is a good, basic structure to use for checking user input. Hint: Have y'all learned about WHILE loops yet?
 08-31-2002, 03:53 AM PM User | #10 duniyadnd Regular Coder   Join Date: Jun 2002 Location: Depends on the time of year Posts: 478 Thanks: 0 Thanked 0 Times in 0 Posts heh, come to think of it, i've learned more from this forum than from my professors at my University. Now that's scary - I want my money back!!! Duniyadnd
 10-06-2002, 06:20 AM PM User | #11 Mhtml Senior Coder     Join Date: Jun 2002 Location: Sydney, Australia Posts: 3,531 Thanks: 0 Thanked 1 Time in 1 Post Schools teach Javascript? __________________ Omnis mico antequam dominus Spookster!
 03-24-2011, 06:29 PM PM User | #12 breentha19 New to the CF scene   Join Date: Mar 2011 Posts: 3 Thanks: 0 Thanked 0 Times in 0 Posts my program does work..need help this is my code which i have done, but the if statement doesnt seem to work. I am not sure why. pls help me on this.
City: State: Zipcode: Customer Code:
Size: King Queen Twin Single