Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC 1351, Fall 2018, Lab 1 Name this project Date Implementing a Gregorian Date Class Implement a basic Date class whose objects represent dates on

image text in transcribed
image text in transcribed
image text in transcribed
CSC 1351, Fall 2018, Lab 1 Name this project Date Implementing a Gregorian Date Class Implement a basic Date class whose objects represent dates on the Gregorlan calendar with no exception-handling capability. Also, write a tester class, DateDemo, that creates Date objects using the constructors, modifies them and prints them out in the day-of-the-week, month-name day, year format using the printf statement. The Date Class The Date class should have month, day and year, all integers, as the fields of a Date object. The class should include the following constructors: Date):creates January 1, 1970 Date(int m, int d, int y): creates a Date object using the specified parameters, where m represents the month, d, the day, and y, the year. Date(Date date): creates an object of the Date class equivalent to the specified date object. The Date class should have the following instance (accessor and mutator) methods: Int getMonth): returns the month in an object of the Date class. Int getDayO: returns the day in an object of the Date class int getYear): retuns the year in an in object of the Date class. vold setDate(int m, int d, Int y): modifies a Date object using the specified parameters where m represents the month, d, the day, and y, the year The DateDemo Class Write a program, DateDemo, that does the following: 1. Prompts the user for the first day of class. 2. Reads a string in the format mm/dd yyyy. parses the string into three integers representing the month, day and year, and uses the parameterized constructor to create a Date object using the three values. 3. Using the copy constructor, creates a second Date object that represents the last day of class. Use the first day of class as an explicit parameter to the constructor 4. Using appropriate accessor methods, prints the first day of class in day-of-the-week month-name day year format

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

3. Provide advice on how to help a plateaued employee.

Answered: 1 week ago