# Need some help with the coding on For Loops..URGENT

• 05-02-2006, 04:38 AM
mr06
Need some help with the coding on For Loops..URGENT
Hey there,

Im a kind of lost with this question and i need some1 to help me go thru the coding..It is not homework i just need to have an full idea on how it is written.Would really appreciate if some1 wrote me the codes along with a simple explanation if possible. I'm having a hard time doing it.. The question is as follows:

A program that uses a for loop to frst take in names and total grades of 5 students.

Your output should look like this:
What is the name of student 1 = ______
Total Mark? ____
The program computes the average of all the total marks and prints out (on screen) the following output.

What is the name of student 1 = Peter
Total Mark? 100
What is the name of student 2 = John
Total Mark? 80
What is the name of student 3 = William
Total Mark? 10
What is the name of student 4 = Kim
Total Mark? 12
What is the name of student 5 = Linda
Total Mark? 0
-------------------------------------------
Peter 100 A
John 90 B
William 10 F
Kim 12 F
Linda 0 F

Average of the class is: 42.4

Thanx, hope its clear enough for u guyz...
• 05-02-2006, 09:08 AM
edburdo
Ok. I won't write it for you, but I'll get you started.

1) Do you know what a For/Next loop is? And how you write one?

Then, inside your loop, prompt the user for the students name. Store this in a variable.
And then prompt for the grade. Store that in a variable.

After the loop, print out the results (determine the letter grade as you go), and average out the class grade.

I would recommend using two arrays to store your date. A String array for the names, and an Integer array for the numbers (use Double if you need decimal precision).

The commands to write and read from the console are part of the Console object.

Console.WriteLine and Console.ReadLine should get you started.
• 05-06-2006, 05:32 AM
mr06
help me plz i need a tutorial on the all the looping including the IF condition DO UNTIL and wat not..Wud really appreciate it.I wanna understand it well
• 05-08-2006, 09:51 AM
edburdo
Pick up a beginners programming book. Conditional structures are the base for most programming, and any good beginner programming book (regardless of language) will cover them.

If you can find a good beginners programming book for VB.Net, then you won't have to figure out the syntax once you know the concept.