Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called Date that includes three pieces of information as class properties: i. Month (type int), ii. Day (type int) and iii. Year

image text in transcribed

Create a class called Date that includes three pieces of information as class properties: i. Month (type int), ii. Day (type int) and iii. Year (type int). 1. Your class Date should have a constructor that initializes the three properties. 2. Implement three properties with appropriate set accessor to validate the values assigned to three properties as follows: i) Day property value should be 1 to 31, when Month property value is (1, 3, 5, 7, 8, 10, 12) ii) Day property value should be 1 to 30, when Month property value is (4, 6, 9, 11) iii) Day property value should be 1 to 29, when Month property value is 2 and Year property value a leap year, if Year property value is not a leap year then Day property value should be 1 to 28. If any property value is not a valid value, then an appropriate message should be displayed to inform the user about the invalid value and the property name. 3. Provide a method DisplayDate that displays the month, day and year separated by forward slashes (/), as show below. Current Date MM/DD/YYYY Write a test app named Date Test that demonstrates class Date's capabilities by a) displaying appropriate prompts (messages) for user to provide input values for three properties (Month, Day, and Year), and receive input values for three properties via keyboard, from the app user. b) calling class Date constructor to create object(s) and initialize three properties of the object by passing input values from step (a) as arguments to the constructor. c) calling DisplayDate method to display the Date class object value in a table as shown above

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

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago

Question

7. Define cultural space.

Answered: 1 week ago