Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program needs to be in Java. We cannot use arrays, switch statement or any library function to count the absolute of the year. Modify
The program needs to be in Java. We cannot use arrays, switch statement or any library function to count the absolute of the year.
Modify the code so that the program prompts the user three questions and output six lines of messages as described below: Your program asks for today's date and two users' birthdays and prints information about them. For both birthdays, the program prints the absolute day of the year on which that birthday falls, the number of days until the user's next birthday. Next the program shows which user's birthday comes sooner in the future. If it is a user's birthday today or if the two birthdays are the same, different messages are printed. Four sample dialogues are shown below, where user input is underlined and expected output is bold (this is only for the instruction purpose to differentiate between user input and expected output). The input date format should contains two integers with a single space in between: Month Day Please enter today's date (month day): 129 Today is 1/29/2023, day \#29 of the year. Please enter person \#1's birthday (month day): 1017 10/17/2023 falls on day #290 of 365. Your next birthday is in 261 day (s). Please enter person \#2's birthday (month day): 1123 11/23/2023 falls on day \#327 of 365 . Your next birthday is in 298 day (s). Person \#1's birthday is sooner. Did ye know? 9/19 be International Talk like a Pirate day. Axr, me mateys, arx! Please enter today's date (month day): 214 Please enter person \#1's birthday (month day): 110 1/10/2024 falls on day #10 of 366 . Your next birthday is in 330 day (s). Please enter person \#2's birthday (month day): 228 2/28/2023 falls on day #59 of 365 . Your next birthday is in 14 day (s). Person \#2's birthday is sooner. Pid ye know? 9/19 be International Talk like a Pirate day. Anx me mateys, axr! Please enter today's date (month day): 11 Today is 1/1/2023, day #1 of the year. Please enter person \#1's birthday (month day): 11 1/1/2023 falls on day \#1 of 365 . Happy Birthday! :) Please enter person \#2's birthday (month day) : 1231 12/31/2023 falls on day \#365 of 365 . Your next birthday is in 364 day (s). Person \#1's birthday is sooner. Did ye know? 9/19 be International Talk like a Pirate day. Arr, me mateys, arr! Please enter today's date (month day): 31 Today is 3/1/2023, day #60 of the year. Please enter person \#1's birthday (month day): 229 2/29/2024 falls on day #60 of 366 . Your next birthday is in 365 day (s). Please enter person \#2's birthday (month day): 229 2/29/2024 falls on day #60 of 366 . Your next birthday is in 365 day (s). Wow, you share the same birthday! ^. Did ye know? 9/19 be International Talk like a Pirate day. Axr, me mateys, arr! Note that the prompt messages and outputs need to be in the exact format as shown above including spacing. Lastly, the program prints a fun fact about your own birthday. Try searching Wikipedia, Bing, or Google for interesting facts about your date of birthday. For example, if yours is Sep. 19, you could print the following fact at the end: Did ye know? 9/19 be International Talk like a Pirate day . Arr, me mateys, arr! Please note: this fun fact should appear on EVERY run - please DO NOT make it appear on one of few specific dates only (i.e., your birth date). c. Keep in mind, this program involves date comparisons in current year of 2023 and next year 2024, which is a "leap year." Leap years have an extra 366 th day, which occurs as February 29 th. d. 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 shown above and do your own testing Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started