Question: Using C# For problems #1-5. create a single console application. In it (and outside the curly brackets of class program). create a class MyLab06. All

Using C#
For problems #1-5. create a single console application. In it (and outside the curly brackets of "class program"). create a class "MyLab06". All the following functions (Q#1-5) must be defined in this new class with public scope. Also illustrate calling each function from void main in the class "program". Each problem is worth 20pts. 1. Develop a public function that displays a prompt to a user to enter a numeric value, checks that it is a numeric value within a specified range (if not, displays an error message and again displays the prompt). and returns the result (as type double). The prompt to display must be passed as an argument to the function. The range should also be passed as optional min and max arguments (use largest negative and positive double values as defaults). 2. Develop a public function that calculates and returns the average length of a server queue. For an M/M1 pa queue (single server, exponential processing and arrival rates), Lq=; while for an M/G/1 queue (single server, exponential arrival rate and any distribution for processing rate) La 2Po+p? pis utilization of the server (a value 20 and 0), and as is the standard deviation of the server processing time (value > 0). These values should be passed to the function ( and Os should be optional arguments). Use an enumeration to define the queue type. The function should print an error message and then throw an exception if any of the arguments are out of range. 3. Write a public void function that takes two values A and B (both int) and swaps their values (puts A value in B and B value in A using ref keyword). 1-2 2(1-P) 4. Write a public function Mult that passed a variable length list of numeric values, returns their multiplication (II X; ). The list may have a variable number of values. For example, Mult(5,7,9,12,2) should return 7560, and Mult(5.6,3,0) should return 0 5. Write a public polymorphic void function to write out a label (text string) and a value to a console. The label and value are passed as arguments to the function. You should have separate versions of the function for double, int, DateTime, String, and Boolean type values. The label should be written out in a 20 character wide left aligned field, followed by the value: a. Double values should be written out in #.##0.00 format (14 character wide field, right align). b. Integers values should be written out in #.##0 format (14 character wide field right align) c. Date values should be written out as short dates (14 character wide field. left align) d. Strings values should be written out as is (14 character wide field. left align truncate string to 14 characters if needed) e. Boolean values should be written out left aligned in a 14 character wide field
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
