Question: Using C# create a single console application. In it (and outside the curly brackets of class program), create a class MyLab. All the following functions

Using C# create a single console application. In it (and outside the curly brackets of "class program"), create a class "MyLab". All the following functions must be defined in this new class with public scope. Also illustrate calling each function from void main in the class "program".

Using C# create a single console application. In it (and outside the

1. Develop a public function that displays a prompt 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). p 2. Develop a public function that calculates and returns the average length of a server queue. For an M/M/1 queue (single server, exponential processing and arrival rates), Lq=; while for an M/G/1 queue (single 1-p 2203+p server, exponential arrival rate and any distribution for processing rate) Lq = pis utilization of the 2(1-P) server (a value = 0 and 0), and os is the standard deviation of the server processing time (value > 0). These values should be passed to the function (a 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). 4. Write a public function Mult that passed a variable length list of numeric values, returns their multiplication (ITX;). 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, Date Time, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!