Question: Using java program Q2) Class Appointment You are asked to create an application that sets appointments for users for a specific venue (place). In order

Using java program  Using java program Q2) Class Appointment You are asked to create
an application that sets appointments for users for a specific venue (place).

Q2) Class Appointment You are asked to create an application that sets appointments for users for a specific venue (place). In order to implement the application you have to create class "Appointment" and use the previously crated class Time" in Q1. The program simply asks the user to enter the date and time of his appointment and the venue. Also, the program makes sure that the entered date is in the future and not before the current date when the user sets his appointment. Class "Appointment" has the following instance variables: Instance variables Valid values venue (type String) appnt (type Time) The date and time set must be after the current date All instance variables must be private. For every instance variable provide a set and get method. The class should only create instances of valid appointment. If a user inserts an invalid date (older than current), the program should output a message stating that the input is invalid and asks the user to insert a valid date. To check the current date use the code snippet shown below: import java.util.calendar Calendar now Calendar.getInstance) int currentYear now.get(Calendar.YEAR) int currentMonth " now.get(Calendar.MONTH)+1; // month start from to 11 int currentDay now.get (Calendar.DATE)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!