Task 6 Write a python function which will take 1 argument, number of days

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 12PE: Write a program that takes as input five numbers and outputs the mean (average) and standard...
icon
Related questions
Question

Task 6

Write a python 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: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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of 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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr