Question: Using java program CpE201-Object Oriented Programming Assignment 2: Classes/Objects/Control Flow Due: Wednesday Oct. 10, 2018 11:00 am hardcopy in class and soft copy in OCS.
CpE201-Object Oriented Programming Assignment 2: Classes/Objects/Control Flow Due: Wednesday Oct. 10, 2018 11:00 am hardcopy in class and soft copy in OCS. Maximum: 100 points Fall 2018 QI ) Class Time A software engineer asks you to write a class called "Time" which represents time and date. The instance variables are the following: Instance variables Valid values day (type integer), month hour (type integer) 1-31 (Note: 31 only allowed for Jan, Mar., May, July, Aug. Oct, and Dec. Strin December (the full name must be between 1900 and 2099 minute inte 59 All instance variables must be private. For every instance variable provide a set and get method. The class should only crcate instances of valid time and date values. The valid values for each instance variable are listed on the table above. If a user inserts an invalid value, the program should output a message stating that the input is invalid and asks the user to insert a valid value. For month instance variable use a "switch" statement. For other instance variables Write a driver class named TimeTest" to allow a user to create an instance of class Time, set the time and date and print their time and date values back to the screen. A sample of the output should be similar to the following Example Execution (user input in green) Example with valid inputs rite the date and time you wish to set Please set the Year: 2018 Please set the Month: September Please set the Day: 20 Please set the Hour: 7 Please set the Minutes: 50
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
