Question
a. Construct a Date class function named isWeekday() that returns a Boolean value of true if the date is a weekday; otherwise, it should return
a. Construct a Date class function named isWeekday() that returns a Boolean value of true if the date is a weekday; otherwise, it should return a false value. The function should call the dayOfWeek() function written for Exercise 5a, and then use the returned integer value to determine whether the day is a weekday. A weekday is any day from 2 to 6, which corresponds to the days Monday through Friday. b. Include the function written for Exercise 6a in a complete program. For testing purposes, use the fact that March 12, 2011, was a Saturday and March 15, 2011, was a Tuesday
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