DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Need some help with the coding on For Loops..URGENT

  1. #1
    Join Date
    May 2006

    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...

  2. #2
    Join Date
    Dec 2005
    South of Nowhere, Maine
    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.

  3. #3
    Join Date
    May 2006
    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

  4. #4
    Join Date
    Dec 2005
    South of Nowhere, Maine
    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.

Similar Threads

  1. SS Tab Controls in (PLz urgent one)
    By samtron in forum ASP.NET
    Replies: 5
    Last Post: 02-21-2006, 01:46 AM
  2. Replies: 1
    Last Post: 01-07-2006, 01:19 PM
  3. Convert applet coding to CSS
    By LogicsHere in forum Java
    Replies: 1
    Last Post: 09-23-2005, 10:13 AM
  4. Replies: 4
    Last Post: 05-24-2005, 06:31 AM
  5. Required Justify coding.
    By Jawed in forum VB Classic
    Replies: 0
    Last Post: 04-01-2001, 11:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center