Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

all20_HW1.pdf + THIS IS TIVI siger LD Page view A Read aloud v Draw Objectives: Basic C# syntax, processing data, creating objects, error checking. Points:

image text in transcribed
image text in transcribed
all20_HW1.pdf + THIS IS TIVI siger LD Page view A Read aloud v Draw Objectives: Basic C# syntax, processing data, creating objects, error checking. Points: 100 Overview: This assignment is designed to exercise your programming skills using C# programming language. There are 4 related parts that you need to code and submit together as a one c-sharp (.cs) file Specification: Part1 1: Read about the System.DateTime structure which contains large number of functionalities that allows developers to work with dates. Using this structure and the System Console to do the following: 1- Create a static void method named Age Calculator inside a class called HW1 2. AgeCalculator should ask the user to enter his date of birth in this format DD/MM/YYYY 3. Store the user's input in a Date Time variable 4. Calculate the age of the user in terms of number of years, months, and days 5. Output the age of the use and his date of birth 6 If the age of the user is wrong such as not born yet or his age is greater than 150, print a message to show the error 7. If it's the user's birthday, output a nice message Part 2: Create a reference type, Le, a class, called Customer with the following properties: first name last name date of birth of type System.Date Time email address preferred color of type COLOR where COLOR is a public enumeration type with some colors gender of type GENDER where GENDER is a public enumeration type with MALE and FEMALE values constructors parameter les constructor custom constructor with first and last name SE V Programming custom constructor with all 5 instance varias read-only properties that calculate the following information 6 FullName: return the full name from the first and the last name Age: returns the age of the customer as a float number o Boy return true If the customer is a male otherwise it returns false o TodayBirthday returns true is today is the birth day of the customer, otherwise it return false Override the ToString method to print out all of the customer's information (all the instance variable should be in the print message in a nice format) Override the Equals method. Two customers are equal if all of their 5 instance variables are equals. For the date of birth, compare their year, month, and day only. Using the object. Memberwise Clone method, create a shallow copy method called ShallowCopy that creates a shallow copy of a customer object Using the Object.Memberwise Clone method, create a deep copy method called DeepCopy that creates a deep copy of a customer object Part 3 Create a class called CustomerTesting to test all the functionalities in the Customer class. This class should have a number of static methods where each method should test a functionality in the Customer class. For example one method could be TestCreatCustomerUsing ParameterlessConstructor that would create a Customer object using the parameter-less constructor There should be at least one method for each mentioned functionality in Part 2 Create a static method in the HW1 class to invoke the testing methods. Important note: All types, classes and enumerations, must have exactly the same names as given in this assignment. For example, if you create a customer class instead of Customer, we will not grade your assignment Submission: Submit your code as a one .cs file to the E-Learning system ON TIME. Late submission will not be accepted. all20_HW1.pdf + THIS IS TIVI siger LD Page view A Read aloud v Draw Objectives: Basic C# syntax, processing data, creating objects, error checking. Points: 100 Overview: This assignment is designed to exercise your programming skills using C# programming language. There are 4 related parts that you need to code and submit together as a one c-sharp (.cs) file Specification: Part1 1: Read about the System.DateTime structure which contains large number of functionalities that allows developers to work with dates. Using this structure and the System Console to do the following: 1- Create a static void method named Age Calculator inside a class called HW1 2. AgeCalculator should ask the user to enter his date of birth in this format DD/MM/YYYY 3. Store the user's input in a Date Time variable 4. Calculate the age of the user in terms of number of years, months, and days 5. Output the age of the use and his date of birth 6 If the age of the user is wrong such as not born yet or his age is greater than 150, print a message to show the error 7. If it's the user's birthday, output a nice message Part 2: Create a reference type, Le, a class, called Customer with the following properties: first name last name date of birth of type System.Date Time email address preferred color of type COLOR where COLOR is a public enumeration type with some colors gender of type GENDER where GENDER is a public enumeration type with MALE and FEMALE values constructors parameter les constructor custom constructor with first and last name SE V Programming custom constructor with all 5 instance varias read-only properties that calculate the following information 6 FullName: return the full name from the first and the last name Age: returns the age of the customer as a float number o Boy return true If the customer is a male otherwise it returns false o TodayBirthday returns true is today is the birth day of the customer, otherwise it return false Override the ToString method to print out all of the customer's information (all the instance variable should be in the print message in a nice format) Override the Equals method. Two customers are equal if all of their 5 instance variables are equals. For the date of birth, compare their year, month, and day only. Using the object. Memberwise Clone method, create a shallow copy method called ShallowCopy that creates a shallow copy of a customer object Using the Object.Memberwise Clone method, create a deep copy method called DeepCopy that creates a deep copy of a customer object Part 3 Create a class called CustomerTesting to test all the functionalities in the Customer class. This class should have a number of static methods where each method should test a functionality in the Customer class. For example one method could be TestCreatCustomerUsing ParameterlessConstructor that would create a Customer object using the parameter-less constructor There should be at least one method for each mentioned functionality in Part 2 Create a static method in the HW1 class to invoke the testing methods. Important note: All types, classes and enumerations, must have exactly the same names as given in this assignment. For example, if you create a customer class instead of Customer, we will not grade your assignment Submission: Submit your code as a one .cs file to the E-Learning system ON TIME. Late submission will not be accepted

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

Learning Sage 50 Accounting A Modular Approach

Authors: Harvey Freedman, Carol Smith Smith

16th Edition

0176741437, 978-0176741433

More Books

Students also viewed these Accounting questions

Question

3-24. Was the message well timed?

Answered: 1 week ago