Write a function which will take 1 argument, number of days. Your first task is to take the number of days as user input and pass the value to the function. Your second task is to implement the function and calculate the total number of years, number of months, and the remaining number of days as output. No need to return any value, print inside the function. Note: Assume, each year to be 365 days and month to be 30 days.

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

Must show it in Python:

Please show step by step with comments.

Please show it in simplest form.

Input and Output must match with the Question

Please go through the Question very carefully.

Task 6
Write a function which will take 1 argument, number of days.
Your first task is to take the number of days as user input and pass the value to the function.
Your second task is to implement the function and calculate the total number of years, number of months, and the remaining number of days as output. No
need to return any value, print inside the function.
Note: Assume, each year to be 365 days and month to be 30 days.
=====
Hint(1):
Divide and mod the main input to get the desired output.
Hint(2): This task's calculation is similar to Assignment-1's seconds to hours, minutes conversion.
===== ====
===== ===
Example01
Input:
4330
Function Call:
function_name(4330)
Output:
11 years, 10 months and 15 days
Transcribed Image Text:Task 6 Write a function which will take 1 argument, number of days. Your first task is to take the number of days as user input and pass the value to the function. Your second task is to implement the function and calculate the total number of years, number of months, and the remaining number of days as output. No need to return any value, print inside the function. Note: Assume, each year to be 365 days and month to be 30 days. ===== Hint(1): Divide and mod the main input to get the desired output. Hint(2): This task's calculation is similar to Assignment-1's seconds to hours, minutes conversion. ===== ==== ===== === Example01 Input: 4330 Function Call: function_name(4330) Output: 11 years, 10 months and 15 days
Example02
Input:
2250
Function Call:
function_name(2250)
Output:
6 years, 2 months and 0 days
Transcribed Image Text:Example02 Input: 2250 Function Call: function_name(2250) Output: 6 years, 2 months and 0 days
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Function Arguments
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