Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that prompts for two people's birthdays (month and day), along with today's month and day. The program should figure out how many

Write a program that prompts for two people's birthdays (month and day), along with today's month and day. The program should figure out how many days remain until each user's birthday and which birthday is sooner.

This is the Output needed:

This program compares two birthdays and displays which one is sooner. What's today's month and day? 1 29 Today is 1/29/2020, day #29 of the year. Person 1: What month and day were you born? 10 17 10/17/2020 falls on day #291 of 366. Your next birthday is in 262 days. That is 71.6 percent of a year away. Person 2: What month and day were you born? 11 23 11/23/2020 falls on day #328 of 366. Your next birthday is in 299 days. 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's today's month and day? 2 14 Today is 2/14/2020, day #45 of the year. Person 1: What month and day were you born? 1 10 1/10/2020 falls on day #10 of 366. Your next birthday is in 331 days. That is 90.4 percent of a year away. Person 2: What month and day were you born? 2 28 2/28/2020 falls on day #59 of 366. Your next birthday is in 14 days. 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's today's month and day? 1 1 Today is 1/1/2020, day #1 of the year. Person 1: What month and day were you born? 1 1 1/1/2020 falls on day #1 of 366. Happy birthday! Person 2: What month and day were you born? 12 31 12/31/2020 falls on day #366 of 366. Your next birthday is in 365 days. 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's today's month and day? 2 28 Today is 2/28/2020, day #59 of the year. Person 1: What month and day were you born? 2 29 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? 2 29 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Java Programs A Back To Basics Approach

Authors: Stuart Reges, Marty Stepp

5th Edition

013547194X, 978-0135471944

More Books

Students also viewed these Programming questions