Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
- 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:
- Double values should be written out in #,##0.00 format (14 character wide field, right align),
- Integers values should be written out in #,##0 format (14 character wide field, right align)
- Date values should be written out as short dates (14 character wide field, left align)
- Strings values should be written out as is (14 character wide field, left align, truncate string to 14 characters if needed)
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started