Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Multi-Dimensional Array
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { enum DAYS {Monday, Tuesday, Wednesday, Thursday, Friday}; public static void Main(string[] args) { int[,] forecastArray = {{65 , 74} , {64 , 72} , {68 , 78} , {70 , 82} , {71 , 83}}; int L = 0; int H = 1; int day = 0; switch(Convert.ToChar(Console.ReadLine())){ case 'M': day = (int)DAYS.Monday; break; case 'T': day = (int)DAYS.Tuesday; break; case 'W': day = (int)DAYS.Wednesday; break; case 'H': day = (int)DAYS.Thursday; break; case 'F': day = (int)DAYS.Friday; break; } Console.WriteLine("Would you like to see H or L?"); switch(Console.ReadLine()){ case "L": Console.WriteLine("The low for " + Enum.GetName(typeof(DAYS) , day) + " is " + forecastArray[day,L]); break; case "H": Console.WriteLine("The high for " + Enum.GetName(typeof(DAYS) , day) + " is " +forecastArray[day,H]); break; default: break; } /* Console.WriteLine(forecastArray[0,0] + " " + forecastArray[0,1] + " \n" + forecastArray[1,0] + " " + forecastArray[1,1] + " \n" + forecastArray[2,0] + " " + forecastArray[2,1] + " \n" + forecastArray[3,0] + " " + forecastArray[3,1] + " \n" + forecastArray[4,0] + " " + forecastArray[4,1] + " \n"); */ } } }
run
|
edit
|
history
|
help
0
Dokkan Awaken Calculator 1.1
dfdfd
,
Cast int to enum in C#
return multiple value from function
mnnjhjhjbhjb
Intuit // C# // listing_4.10 (for..)
Use Lock Keyword
Calculadora
Unicode Braille Patterns.