/* Programma che calcola L`IVA e le quote d`ammortamento. Copyright (C) 2001 Nicola Piazzolla 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Created By kc */ #include #include #include /* VARIABILI */ int end; void info(); void iva1(); /* Dichiarazione di funzioni con valore di non ritorno */ void amm2(); int main (void) { /* Funzione con valore di ritorno perche e` un intero */ printf("Software Per La Gestione Aziendale\n"); printf("*********************MENU*********************\n"); printf("* Premere 1 per calcolare l`IVA *\n"); printf("* Premere 2 per calcolare l`Ammortamento *\n"); printf("* Premere 3 per uscire. *\n"); printf("* Premere 4 per le INFO *\n"); printf("* Premere 000 per uscire ovunque ci si trovi *\n"); printf("**********************************************\n"); while (1) { printf("MENU SCELTA: "); scanf("%d",&end); switch (end) { /* Uso dello switch */ case 1 : iva1(); break; case 2 : amm2(); break; case 3: printf("Bye bye\n"); return 0; break; case 4 : info(); break; default : perror("Valore inserito non valido"); } } return 0; /* Valore di ritorno per la funzione int main(void) */ } void iva1() { int capitale; int iva; int risultato; printf("Inserire il Capitale: "); scanf("%d",&capitale); if(capitale==000) { printf("Exit\n"); exit(1); } printf("Inserire l`IVA : "); scanf("%d",&iva); if ( iva==000) { printf("Exit\n"); exit(1); } risultato=(capitale*iva)/100; printf("Il risultato e` %d \n",risultato); getchar(); } void amm2 () { int capitale; int iva; int risultato; printf("Inserire il Capitale: "); scanf("%d",&capitale); if(capitale==000) { printf("Exit\n"); exit(1); } printf("Inserire l`IVA : "); scanf("%d",&iva); if ( iva==000) { printf("Exit\n"); exit(1); } risultato=(capitale*iva)/100; printf("La quota d`ammortamento e` %d \n",risultato); } void info() { printf("Nick : kc ; Contact : email \n"); printf("IRC: server channel < #penguin.it > \n"); }