using c++ Write a function daysInMonth that accepts an integer year, and an integer monthNum and returns the number of days in that month. Note that “30 days past September, April, June, and November”, etc. You need to include the year as you have to determine whether it is a leap year in order to decide whether to add 28 or 29 days for Feburary. MonthNum has a value of 1 to 12 with 1 as January and 12 as December. Note that you probably will need to call your isLeapYear function from a previous exercise to be able to write your daysInMonth function.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.3: Returning Multiple Value
Problem 6E
icon
Related questions
Question

9. using c++ Write a function daysInMonth that accepts an integer year, and an integer monthNum and returns the number of days in that month. Note that “30 days past September, April, June, and November”, etc. You need to include the year as you have to determine whether it is a leap year in order to decide whether to add 28 or 29 days for Feburary. MonthNum has a value of 1 to 12 with 1 as January and 12 as December. Note that you probably will need to call your isLeapYear function from a previous exercise to be able to write your daysInMonth function.

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Returning value from Function
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning