hey les gars. Je me promenais si quelqu'un savait comment créer du code pour que la console ne soit pas ouverte, plutôt une page web formatée.code de sortie dans la page Web formatée
toutes les suggestions seront très appréciées!
concernant
namespace Grades
{
class Program
{
static void Main()
{
Console.WriteLine("\t\tValue Distribution\n");
String text = File.ReadAllText(@"values.dat"); //obviously change file path again
char[] c = text.ToCharArray(); //convert to char array
var g = c.OrderBy(a => a); //order array
foreach (char group in g)
{
Console.WriteLine(group.ToString()); //loop, displaying ordered array
}
//
int aCount = c.Count(a => a == 'A'); //count all 'A' instances
int bCount = c.Count(b => b == 'B'); //count all 'B' instances
int cCount = c.Count(cc => cc == 'C'); //count all 'C' instances
int dCount = c.Count(d => d == 'D'); //count all 'D' instances
int eCount = c.Count(e => e == 'E'); //count all ''E' instances
int fCount = c.Count(f => f == 'F'); //count all 'F' instances
//
Console.WriteLine("\nA = {0}", aCount);
Console.WriteLine("B = {0}", bCount);
Console.WriteLine("C = {0}", cCount);
Console.WriteLine("D = {0}", dCount);
Console.WriteLine("E = {0}", eCount);
Console.WriteLine("F = {0}", fCount);
//multiplying amount in each group by 2
aCount = aCount * 2;
bCount = bCount * 2;
cCount = cCount * 2;
dCount = dCount * 2;
eCount = eCount * 2;
fCount = fCount * 2;
//outputs graph display
Console.WriteLine("\n0 10 20 30 40 50 60 70 80 90 100");
Console.WriteLine("| | | | | | | | | | |");
Console.WriteLine("**************************************************");
//outputs each grade according to the multiplied amount and is therefore displayed with asteriks
Console.Write(new String('*', aCount)); Console.Write(" A\n");
Console.Write(new String('*', bCount)); Console.Write(" B\n");
Console.Write(new String('*', cCount)); Console.Write(" C\n");
Console.Write(new String('*', dCount)); Console.Write(" D\n");
Console.Write(new String('*', eCount)); Console.Write(" E\n");
Console.Write(new String('*', fCount)); Console.Write(" F\n");
Quel est le contexte de cette sortie de code? D'où vient-il? – climbage
si vous voyez ce qui précède, j'ai ajouté mon code actuel, et comme vous pouvez le voir les informations proviennent d'un fichier nommé values.dat. salutations – Simagen
@climbage il a fallu une minute pour comprendre cela. Il veut générer une page Web pour afficher ses résultats. @cameron, pouvez-vous utiliser ASP.NET? Cela facilitera les choses, parce que vous ne forcerez pas un navigateur particulier à ouvrir, mais que vous laisserez le choix de son propre navigateur et que vous le laisserez visiter votre page Web. C'est ce que je ferais. Mais c'est juste moi. – jcolebrand