Write a method dateIsBefore that takes as parameters two month/day combinations and that returns whether or not the first date comes before the second date (true if the first month/day comes before the second month/day, false if it does not). The method will take four integers as parameters that represent the two month/day combinations.
Write a method dateIsBefore that takes as parameters two month/day combinations and that returns whether or not the first date comes before the second date (true if the first month/day comes before the second month/day, false if it does not). The method will take four integers as parameters that represent the two month/day combinations.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 9E
Related questions
Question
Write the java program for below
![Write a method dateIsBefore that takes as parameters two month/day
combinations and that returns whether or not the first date comes before the second
date (true if the first month/day comes before the second month/day, false if it does
not). The method will take four integers as parameters that represent the two
month/day combinations.
The first integer in each pair represents the month and will be a value between 1 and
12 (1 for January, 2 for February, etc, up to 12 for December). The second integer in
each pair represents the day of the month (a value between 1 and 31). One date is
considered to come before another if it comes earlier in the year.
Below are sample calls on the method.
Method Call
Return
Explanation
dateIsBefore(6, 3, 9, 20)
true
June 3 comes before Sep 20
dateIsBefore(10, 1, 2, 25) false
dateIsBefore(8, 15, 8, 15) false
dateIsBefore(8, 15, 8, 16) true
Oct 1 does not come before Feb 25
Aug 15 does not come before Aug 15
Aug 15 comes before Aug 16](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc0b8c300-505a-46a4-b059-acd4a2b39e1f%2F715298df-fd73-43e1-bfbc-b30c17a287f1%2Fzcagvh_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Write a method dateIsBefore that takes as parameters two month/day
combinations and that returns whether or not the first date comes before the second
date (true if the first month/day comes before the second month/day, false if it does
not). The method will take four integers as parameters that represent the two
month/day combinations.
The first integer in each pair represents the month and will be a value between 1 and
12 (1 for January, 2 for February, etc, up to 12 for December). The second integer in
each pair represents the day of the month (a value between 1 and 31). One date is
considered to come before another if it comes earlier in the year.
Below are sample calls on the method.
Method Call
Return
Explanation
dateIsBefore(6, 3, 9, 20)
true
June 3 comes before Sep 20
dateIsBefore(10, 1, 2, 25) false
dateIsBefore(8, 15, 8, 15) false
dateIsBefore(8, 15, 8, 16) true
Oct 1 does not come before Feb 25
Aug 15 does not come before Aug 15
Aug 15 comes before Aug 16
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,