Question: please help java program this is for Q1 - name: String - civillD: String - dateOfBirth: Date - expirationDate: Date - currentDate: Date This is

please help java program  please help java program this is for Q1 - name: String
- civillD: String - dateOfBirth: Date - expirationDate: Date - currentDate: Date
This is static/final and set to today's date. Class Date is provided
for you, so you do not need to implement it. Your Citizen
class should have: - A constructor that initializes the name, civillD, dateOfBirth,
expirationDate. - A second constructor that takes 0 arguments and initializes name
this is for Q1
and civillD to "N/A"; and initializes the dateOfBirth (day, month, and year)
(of class Date) to 1,1, 2000, respectively, and finally the expirationDate to
1,1,3000. - A third constructor that takes only name and civillD, initializes

- name: String - civillD: String - dateOfBirth: Date - expirationDate: Date - currentDate: Date This is static/final and set to today's date. Class Date is provided for you, so you do not need to implement it. Your Citizen class should have: - A constructor that initializes the name, civillD, dateOfBirth, expirationDate. - A second constructor that takes 0 arguments and initializes name and civillD to "N/A"; and initializes the dateOfBirth (day, month, and year) (of class Date) to 1,1, 2000, respectively, and finally the expirationDate to 1,1,3000. - A third constructor that takes only name and civillD, initializes the dateOfBirth day, month, and year to 1,1,2000, and initializes expirationDate to 1,1, 3000 respectively. - set and get methods for all your instance variables with valid values. The class also should include methods that: 1. checkExpiration: check the object's expiration has occurred (need to check current date for this) and print a statement that alerts the user. Write another class called CitizenTest that includes the main method. Your main should do the following: - Print the Current Date at the top of the console. - Create an array of type Citizen with a size of 5. - Create each object of the array manually and initialize it as follows: Array element 0 : When you create the object, pass to the constructor 0 parameters Array element 1: pass to the constructor only: "Ahmed", "299060700244" Array element 2: pass to the constructor: "Sara","298060300744",6,3,1998,6,3,2026 Array element 3: pass to the constructor: "Noura"," 290170500284",17,5,1990, 18,5,2030 Array element 4: pass to the constructor: "Ali","295200100994",20,1,1995, 21,1,2020 - Finally, use a for loop to go through each element of the array and print the name and date of birth (use the method formattedDate from the class Date to get the date of birth in a formatted string). Hint: use "import java.time.LocalDateTime;" and the variable of the class called "LocalDateTime" assigned to "LocalDateTime.now()" with methods ". getDayOfMonth(), ..getMonthValue(), ..getYear()" to get the day/month/year format for today's date. Your output should look exactly as shown below: Q2. [5 pts] A company has 3 salesmen and sells 5 different products. Each month the company computes: - the total number of sold items of each product, and - the total number of sold item for each salesman. Use a two-dimensional array to store the number of products sold by each salesman. Read the number of sold items of each salesman from the user. Then print the total number of sold items for each product and the total number of sold item of each salesman. Sample output: Enter the number of sold items for salesman 0 Product 0: 2 Product 1: 5 Product 2: 3 Product 3:4 Product 4:2 Enter the number of sold items for salesman 1 Product 0:6 Product 1:7. Product 2: 2 Product 3:4 Product 4: 5 Enter the number of sold items for salesman 2 Product 0.2 Product 1: 4 Product 2: Product 3: Product 4: Number of sold items for product 0 is 10 Number of sold items for product 1 is 16 Number of sold items for product 2 is 8 Number of sold items for product 3 is :17 Number of sold items for product 4 is 13 3//end of class t java.time. LocalDateTime; class Date \{ private int day; private int month; private int year; I ======== Constructor ================ public Date (int day, int month, int year) \{ if ( day 31) \{ System.out.println( "Error: Day out of range"); this. day =1; \} else this. day = day; if(month 12) \{ System.out.println("Error: Month out of range"); this. month =1; 3. else this. month = month; if (year =2000; \} else this.year = year; 3/lend of constructor public string formattedDate() \{ return String. format( %02d/%02d/%d", getDay(), getMonth(), getYear \}//end of formated Date lend of class

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!