84 714
Assignments Done
99,1%
Successfully Done
In March 2020

# Answer to Question #44739 in C# for Esther

Question #44739
Using C# Console Application , How do you assign a symbol from A to F depending on their average A&gt;=80 &amp; 100 B&gt;=70 &amp; 79 C&gt;=60 &amp; 69 D&gt;=50 &amp; 59 E&gt;= 40&amp; 49 F&lt;40
1
Expert's answer
2014-08-07T04:10:26-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
namespace Sharp_44739
{
class Program
{
static void Main(string[] args)
{
int digit;
char result;
do
{
Console.Clear();
Console.WriteLine("Please enter integer average mark:");
if (!Int32.TryParse(Console.ReadLine(), out digit) || digit < 0 || digit> 100)
{
Console.WriteLine("Wrong input!. Press any key to continue...");
Console.ReadKey();
continue;
}
if (digit >= 80) result = 'A';
else
if (digit >= 70) result = 'B';
else
if (digit >= 60) result = 'C';
else
if (digit >= 50) result = 'D';
else
if (digit >= 40) result = 'E';
else result = 'F';
Console.WriteLine("Assigned value is: {0}\nPress ESC to exit or anything to continue...", result);
} while (Console.ReadKey().Key != ConsoleKey.Escape);
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

#### Comments

No comments. Be first!

### Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS