Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a console application that emulates the screen shot shown below. The program asks the user for input (top section of the screenshot), then creates

Write a console application that emulates the screen shot shown below. The program asks the user for input (top section of the screenshot), then creates three instances of Contact objects, then adds them to an array and then outputs the contents to the console (bottom part of the screenshot)

image text in transcribed

everything in c# using visual studio 1) Name your project COMP3602Assign02. 2) Create a class named Contact in a separate source file with the following fields:

FirstName LastName Age Address City Province PostalCode 3) Create property methods for each field 4) Write any appropriate constructor or constructors 5) Override the ToString method to return LastName, FirstName using an interpolated string 6) Prompt and collect data for three contacts from the user 7) Use the collected data to create and populate three instances of the Contact class 8) Populate the objects using the three techniques discussed in class this week: 1. For the first Contact, create an empty object and then populate the data via properties 2. For the second Contact, call a parameterized constructor 3. For the third Contact, use the Object Initializer syntax 9) Add the Contact objects to an array 10) Output the contents of the Contact objects by iterating through the array (check out the for each loop) Format the output as follows (Canadian Postal standards plus age): FirstName LastName (Age) Address City Province PostalCode (one space between City and Province, two spaces between Province and Postal Code) 11) Place the output code (all code that is outputting text to the console) in one or more utility methods in a dedicated class (in a separate source file) 12) Set the Console Title property as shown in the screenshot above (using your Student Number-12345678)

65. COMP3602 Assigmmenl 2 A00123456 Enter Contact Information First Name: Kevin Last Name: Gill Age: 42 Address: 45645 Muffin Dr. City: Sunnydale Province: BC Postal Code:V4T Y8U First Name: Tanya Last Name: Sounders Age: 54 Address: 103-4590 Vision Pl City: Charming Province: BC Postal Code: V6H I80 First Name: Last Name: Boss Age: 23 Address: 1207-5566 Blank St City: Valleyville Province: AB Postal Code:M4R Y 6Y Contacts Entered: Kevin Gill (42) 45645 Muffin Dr. Sunnydale BC V4T Y8U Tanya Sounders (54) 103-4590 Vision P1 Charming BC V6H I80 Boss (23) 12075566 Blank St Valleyville AB MAR Y 6 Y

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_2

Step: 3

blur-text-image_3

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions

Question

Discuss the importance of workforce planning.

Answered: 1 week ago

Question

Differentiate between a mission statement and a vision statement.

Answered: 1 week ago