Created
May 25, 2016 21:21
-
-
Save dejibimbolaAyo/14d33b8493618e80e86d696e48f0043e to your computer and use it in GitHub Desktop.
tests score and grades score
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace test_fail_with_grades | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int score = 0; | |
int accumulate = 0; | |
for (int n = 0; n < 10; n++) | |
{ | |
accumulate = Convert.ToInt32(Console.ReadLine()); | |
if (accumulate > 10) | |
{ Console.WriteLine("please enter a valid score not above 10"); | |
n--; } | |
else | |
score = score + accumulate; | |
} | |
if (score <= 100 && score >= 70) | |
{ | |
Console.WriteLine("distinction"); | |
Console.WriteLine("A {0}", score); | |
} | |
else if (score <= 69 && score >= 55) | |
{ | |
Console.WriteLine("credit"); | |
Console.WriteLine("C {0}", score); | |
} | |
else if (score <= 54 && score >= 40) | |
{ | |
Console.WriteLine("pass"); | |
Console.WriteLine("P {0}", score); | |
} | |
else if (score <= 39 && score >= 0) | |
{ | |
Console.WriteLine("failed"); | |
Console.WriteLine("F {0}", score); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment