Using C# Console Application , How do you assign a symbol from A to F depending on their average
A>=80 & 100
B>=70 & 79
C>=60 & 69
D>=50 & 59
E>= 40& 49
F<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); } } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment