Create a console application to display different messages depending onthe command line argument value. Use Select-case statements.(similar toswitch block)
1
Expert's answer
2011-05-23T11:18:57-0400
using System;
namespace CommandLineArguments { class Program { & static void Main(string[] args) & { // The first element of the array is the name of the program, // so we'll ignore it (it isn't a parameter) for (int i = 0; i < args.Length; i++) { // Looking for some special parameters switch (args[i]) { & case "-h": Console.WriteLine("The help parameter was detected!"); break; & case "a": Console.WriteLine("The parameter 'a' was detected!"); break; & case "b": Console.WriteLine("The parameter 'b' was detected!"); break; & case "c": Console.WriteLine("The parameter 'c' was detected!"); break; & case "SomeParameter": Console.WriteLine("'SomeParameter was detected!"); break;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment