Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a program created using Java. Details below. I have the first part which

ID: 3591895 • Letter: I

Question

I need a program created using Java. Details below. I have the first part which is just the basic program, but now I need the extra features to be added.

EXTRA FEATURES FOR THE PROGRAM

Finally, three features make the software even more useful. The first is a what-if inquiry. The second finds peak concentration. The third calculates when to take a dosage to reach a predefined concentration.

For the first feature, the user wants to test a scenario of the patient taking a dosage. The scenario is a whatif. It won’t permanently add to the list of dosages. The scenario is of a dosage at that moment or of a dosage at a time in the future. Thus, the input is dosage and time. If the input doesn’t include a time, the software uses the current time. The output is the concentration amount at the time specified in the input. It considers the current list of dosages and the scenario dosage to make that determination.

What-If Feature For the first feature, the user wants to test a scenario of the patient taking a dosage. The scenario is a whatif. It won’t permanently add to the list of dosages. The scenario is of a dosage at that moment or of a dosage at a time in the future. Thus, the input is dosage and time. If the input doesn’t include a time, the software uses the current time. The output is the concentration amount at the time specified in the input. It considers the current list of dosages and the scenario dosage to make that determination.

Explanation / Answer

//Returns the number of days in month (in year) public static int daysIn (int month, int year) throws IllegalArgumentException { if (year < 1) throw new IllegalArgumentException ("daysIn: year ("+year+") not positive"); if (month DECEMBER) throw new IllegalArgumentException ("daysIn: month ("+month+") not in range [1,12]"); //Thirty days hath September, April, June and November... if (month == APRIL || month == JUNE || month == SEPTEMBER || month == NOVEMBER) return 30; //...all the rest have thirty one... else if (month == JANUARY || month == MARCH || month == MAY || month == JULY || month == AUGUST || month == OCTOBER || month == DECEMBER) return 31; //...except February (must be FEBRUARY in else: see possible exception) else /* if (month == FEBRUARY) */ return 28 + (isLeapYear(year) ? 1 : 0); } //Returns the ordinal (1st, 2nd, 3rd, etc) representing month, day, year public static int ordinalDate (int month, int day, int year) { int ordinal = 0; //Scan every earlier month, summing the # of days in that month... for (int m=JANUARY; m
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote