Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective The purpose of this lab is to practice creating classes in C# using the object initialization techniques we looked at this week. Details i.

Objective The purpose of this lab is to practice creating classes in C# using the object initialization techniques we looked at this week. Details i. Create a Visual Studio C# Console project named COMP3602Lab02. ii. Write a class named Member in a separate source (.cs) file with the following: Three Property Methods named FirstName, LastName and Age (use appropriate data types) A Calculated Property Method named AgeInDecades (use an appropriate data type and calculation) Override the ToString method to return Firstname Lastname. Use a composite string rather than the + operator to concatenate the properties. iii. In the Main method in the Program class do the following: Instantiate five Member objects using the Object Initializer syntax and add them to an array. Using a loop, iterate through the array and emulate the output shown in the screen shot below: (use composite strings) Place the output (UI) code in a utility method in a dedicated class (in a separate source file)

image text in transcribed

\begin{tabular}{llrr} \hline FirstName & LastName & AgeYears & AgeDecades \\ \hline Tim & Conway & 61 & 6.1 \\ Larry & Sanders & 60 & 6.0 \\ Howard & Stern & 58 & 5.8 \\ Steven & Wright & 56 & 5.6 \\ Lewis & Black & 64 & 6.4 \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Write Responses on net neutrality

Answered: 1 week ago

Question

=+8.4. Show that B 8 [W] k-0 n=1m=1 A-1

Answered: 1 week ago