/*
Copyright (C) 2013 Alessandro Bugatti (alessandro.bugatti@istruzione.it)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*! \file
* \brief Fare un programma in C che faccia inserire all'utente un numero che rappresenta un investimento in euro e comunichi la rendita dell'investimento dopo un anno. Le regole per il calcolo della rendita sono le seguenti: la parte di investimento sotto i 10000 euro rende lo 0.7% annuo, la parte compresa tra i 10000 e i 50000 euro lo 0.9% annuo e la parte superiore a 50000 euro rende l'1.3%. Infine se l'investimento è superiore ai 200000 verrà sempre corrisposto un bonus fisso di 1000 euro oltre alla rendita già spiegata.
* \author Alessandro Bugatti
*
* \version 0.1
* \date Creazione 29/10/2013
* \date Ultima modifica 29/10/2013
*
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
float investimento, rendita;
printf("Inserisci l'investimento: ");
scanf("%f",&investimento);
if (investimento <= 10000)
rendita = investimento*0.7/100;
else if (investimento <= 50000)
rendita = 10000*0.7/100 + (investimento - 10000)*0.9/100;
else
rendita = 10000*0.7/100 + 40000*0.9/100 + (investimento - 50000)*1.3/100;
if (investimento > 200000)
rendita+=1000;
printf("La rendita del tuo investimento e': %f euro.\n",rendita);
return 0;
}