Given an initial capital in euros, an annual interest rate (expressed in %), a time in years and an indication whether the interest is simple or compound, determine the amount of euros the initial capital is transformed into.
The input consists of two strictly positive real numbers
and
,
followed by a strictly positive integer
,
followed by either the word “simple” or the word
“compound”.
Write the final capital with 4 decimal places.
If you program in C++, use the double data type and put
these two lines at the beginning of your main():
cout.setf(ios::fixed);
cout.precision(4);
Author: Unknown
Translator: Gabriel Valiente
Generation: 2026-01-25T12:05:48.738Z
© Jutge.org, 2006–2026.
https://jutge.org