|
-
March 19th, 2012, 07:47 AM
#1
Need Help with C# program
Hi I am very new to C#. In an attempt to create a small program that asks the user to input grades and then outputs the grade average, I ran into some issues. This is what I have so far.
I know that it is no where near done, and probably wrong. I would just need to know how to assign the grades A,B,C,D,F and give them values for the calculations. Can anyone help in this matter?
Thanks
Tom
string[] grades = new String[5];
int index = 0;
//loop to have the user input arrays values dynamically
for (index = 0; index <= 4; index++)
{
Console.WriteLine("Enter of your grade " + (index + 1) + ": ");
grades[index] = Console.ReadLine();
}
// loop to print out array values
Console.WriteLine("\nThese are the grades you entered.");
Console.WriteLine("Your Grade average is" index++ / 5);
for (index = 0; index <= 4; index++)
{
Console.WriteLine(grades[index] + "\n");
}
Console.WriteLine("\nPress [Enter] key to exit.");
Console.ReadLine();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|