204k views
1 vote
Complete the function ConvertToDecadesAndYears to convert totalYears to decades and years. Return decades and years using the TimeDecadesYears struct. Ex: 26 years is 2 decades and 6 years.

1 Answer

6 votes

Answer:

It is a C++ program. The complete function ConvertToDecadesAndYears which takes totalYears as parameter and convert totalYears to decades and years is provided in the attached document.

Step-by-step explanation:

The explanation is provided in the attached document.

The screenshot of the complete code along with its output is attached.

Complete the function ConvertToDecadesAndYears to convert totalYears to decades and-example-1
User Mehdi Chennoufi
by
5.4k points