Answered You can hire a professional tutor to get the answer.

QUESTION

Intro to Java: (Only the Invoice class and InvoiceApp class need editing. Also, I will tip) Brief:

Intro to Java: (Only the Invoice class and InvoiceApp class need editing. Also, I will tip)Brief: Modify the Invoice class so it contains methods that return a due date, calculated as 30 days after the invoice date. Then, you'll modify the InvoiceApp class to display the invoice date and due date for a batch of invoices.1.) Add two methods named getDueDate and getFormattedDueDate to the Invoice class. The getDueDate method should calculate and return a Date object that's 30 days after the invoice date. The getFormattedDueDate method should return the due date in the short date format.2.) Modify the displaylnvoices method in the InvoiceApp class so that the invoice display includes columns for the invoice date and the due date in addition to the invoice number and total. (I attached a zip file and the classes separately depending on which you'd like to use. Thank you.)

  • Attachment 1
  • Attachment 2
  • Attachment 3
  • Attachment 4
  • Attachment 5
  • Attachment 6
  • Attachment 7
  • Attachment 8
  • Attachment 9
import java.util.*;public class DateUtils {static final int MILLS_IN_DAY = 24 * 60 * 60 * 1000;public static Date getCurrentDate() {GregorianCalendar currentDate = new GregorianCalendar();currentDate.set(Calendar.HOUR, 0);currentDate.set(Calendar.MINUTE, 0);currentDate.set(Calendar.SECOND, 0);return currentDate.getTime();}public static Date createDate(int year, int month, int day) {GregorianCalendar date = new GregorianCalendar(year, month, day);return date.getTime();}public static Date stripTime(Date date) {GregorianCalendar currentDate = new GregorianCalendar();currentDate.setTime(date);currentDate.set(Calendar.HOUR, 0);currentDate.set(Calendar.MINUTE, 0);currentDate.set(Calendar.SECOND, 0);return currentDate.getTime();} } public static int daysDiff(Date date1, Date date2) {date1 = stripTime(date1);date2 = stripTime(date2);long longDate1 = date1.getTime();long longDate2 = date2.getTime();long longDiff = longDate2 - longDate1;return (int) (longDiff / MILLS_IN_DAY);}
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question