Question: Please help me with this, I don't know how to put all of this into static methods and such. Task: This assignment will give you

Please help me with this, I don't know how to put all of this into static methods and such.

Please help me with this, I don't know how to put allof this into static methods and such. Task: This assignment will giveyou practice with if/else statements, loops, interactive programs with Scanner, cumulative sumalgorithms, parameters, and return statements. Turn in a Java file named Birthdays.java.

Task: This assignment will give you practice with if/else statements, loops, interactive programs with Scanner, cumulative sum algorithms, parameters, and return statements. Turn in a Java file named Birthdays.java. This program involves date comparisons in 2020, which is a "leap year." Leap years have an extra 366th day, which occurs as February 29th. The 366 days are divided among the 12 months as follows: Examples: The following is a single run of your program and their expected output (user input is bold and underlined): This program compares two birthdays and displays which one is sooner. What is today's month and day? 129 Today is 1/29/2020, day \#29 of the year. Person 1: What month and day were you born? 1017 10/17/2020 falls on day \#291 of 366 . Your next birthday is in 262 day(s). That is 71.6 percent of a year away. Person 2: What month and day were you born? 1123 11/23/2020 falls on day \#328 of 366 . Your next birthday is in 299 day(s). That is 81.7 percent of a year away. Person 1 's birthday is sooner. your birthday fact here Would you like to compare two more birthdays? Type 1 and then to compare two more birthdays Type 2 to end the program 1 This program compares two birthdays and displays which one is sooner. What is today's month and day? 214 Today is 2/14/2020, day \#45 of the year. Person 1: What month and day were you born? 110 1/10/2020 falls on day #10 of 366 . Your next birthday is in 331 day(s). That is 90.4 percent of a year away. Person 2: What month and day were you born? 228 2/28/2020 falls on day \#59 of 366 . Your next birthday is in 14 day(s). That is 3.8 percent of a year away. Person 2's birthday is sooner. your birthday fact here Would you like to compare two more birthdays? Type 1 and then to compare two more birthdays Type 2 to end the program 1 This program compares two birthdays and displays which one is sooner. What is today's month and day? 11 Today is 1/1/2020, day \#1 of the year. Person 1: What month and day were you born? 11 1/1/2020 falls on day \#1 of 366 . Happy birthday! Person 2: What month and day were you born? 1231 12/31/2020 falls on day \#366 of 366. Your next birthday is in 365 day(s). That is 99.7 percent of a year away. Person 1 's birthday is sooner. your birthday fact here Would you like to compare two more birthdays? Type 1 and then to compare two more birthdays Type 2 to end the program 1 This program compares two birthdays and displays which one is sooner. What is today's month and day? 228 Today is 2/28/2020, day \#59 of the year. Person 1: What month and day were you born? 229 2/29/2020 falls on day \#60 of 366 . Your next birthday is in 1 day (s). That is 0.3 percent of a year away. Person 2: What month and day were you born? 229 2/29/2020 falls on day #60 of 366 . Your next birthday is in 1 day(s). That is 0.3 percent of a year away. Wow, you share the same birthday! your birthday fact here > Would you like to compare two more birthdays? Type 1 and then to compare two more birthdays Type 2 to end the program 2 Thank you for using the program. Have a good day! Since this is an interactive program, it behaves differently when given different input. The examples above may not show all possible cases. Please examine all example outputs on the web site and do your own testing. You may assume that all user input is valid, and that the program is being run between 1/1/2020 and 2/28/2020 Absolute day of the year: One major task in this program is computing the absolute day of the year on which each user's birthday falls in 2020. Jan 1 is day \#1. Jan 2 is \#2. Jan 31 is \#31. Feb 1 is \#32. And so on, up to Dec 31 , which is \#366. You must compute absolute days of the year by writing a particular static method. For reference, the following are the absolute days for the first day of each month. NOTE: Your method to compute the absolute days in the year should never return / use these values directly. Instead, your 'absolute day' method must use a 'cumulative sum' approach that involves adding up the relevant months one at a time. This table is here just to help you test/double-check that your code is working correctly. You can type a date into your program (say, June 2nd) and then check that your program produces 154 as the answer (June 1st is 153 from the table below, plus 1 more day for June 2 nd). This method should accept parameters representing a month and day and should return the absolute day of the year 2020 that is represented by those parameters. For example, calling this method with the parameter values of 2 and 13 (representing February 13th, 2020) should return 44, and calling it with parameter values of 9 and 19 (representing September 19th, 2020) should return 263. This method should not produce any console output, though the result it returns can be printed by code elsewhere in your program. Your method must compute its value using a cumulative sum as described in section 4.1 of the textbook. To perform this calculation, you will also need code to evaluate the number of days in each particular month. You should put this code into a method that accepts a month parameter and returns the number of days in that month. Days until next birthday: Another major task is computing how many days remain until each user's next birthday. There are several cases to consider. If the user's birthday falls after today's date, it is within the year 2020 . However, if it falls before today's date, the next birthday occurs in the year 2021, so you'll need to think of a way to count the days that "wrap around" between today and the end of 2020 , and then the start of 2021 to the user's birthday in 2021. For example, consider the first example output on the previous page. The current day is 1/29, and the two users' birthdays are 10/17 and 11/23. User \#1's birthday is 262 days away, and User \#2's is 299 , so \#1 is sooner: Now consider the second example output. The current day is 2/14, and the two users' birthdays are 1/10 and 2/28. In this case, User \#1's next birthday "wraps around" to the next year, 2021, and is 331 days away. It may be helpful to notice that it takes 331 days to move forward from 2/14 to 1/10, and it takes 35 days to move forward from 1/10 to 2/14, and that these two values add up to 366

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!