Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE 215.3 Fall 2021 Assignment #2 Due Date: 8 January 2022 Define a class based on the UML class diagram according to your NSU ID.

image text in transcribed

CSE 215.3 Fall 2021 Assignment #2 Due Date: 8 January 2022 Define a class based on the UML class diagram according to your NSU ID. Choose NewDate if your middle four digits of your NSU ID is odd, otherwise choose NewTime. The first constructor initialized with today's date or current time. The second constructor initialized the object with the given string. The separator of the elements may be '','orUse split method of String class. The third constructor extract Date or Time elements from the given Calendar object. Codes for extracting information from Calendar object is given below. The other methods are self- explanatory NewDate -day, month, year int winterface. Comparable +compare To(NewDate o int +NewDate +NewDate(st:String) +NewDate(at:Calendar *setDate(d.my.int) boolean getDate:NewDate + differenced NewDate): int |+compare Tod:NewDate) int +clone Object +toStringo String interface. Cloneable NewTime -hour, minute, second int interface. Comparable - compare To(NewTime 0) int +NewTimeo +NewTime(s:String) +NewTime(t.Calendar) + setTime(ss, mm hh:int):boolean |.getTime(NewTime + difference(t. NewTime) int +compare TortNewTime).int + clone(Object +toStringo:String -interface. Cloneable Create 3 objects with reference variables x,y and z using three constructors. Show the usage of set, get, difference, compareTo, clone and toString methods using these objects in the main method defined in the same class. Calendar ga = new GregorianCalendar(); day = gc.get (Calendar.DAY OF MONTH); month = gc.get(Calendar. MONTH)+1

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago