/* Cspeed2 Convertitore di velocita` da Kmh a Mph Nodi e Kmh e viceversa. Copyright (C) 2001-2002 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 float x,y,converte ; int scelta; /* VARIABILI */ float nodi[3]; main () { printf("\t\tCONVERTITORE VELOCITA`\n"); printf("*************************************************\n"); printf("*Convertitore Velocita' da kmh a mph e viceversa*\n"); printf("*Digitare 1 per convertire da kmh a mph *\n"); printf("*Digitare 2 per convertire da mph a kmh *\n"); /* MENU */ printf("*Digitare 3 per le INFO *\n"); printf("*Digitare 4 per convertire da Nodi(Kts) a kmh *\n"); printf("*Digitare 5 per convertire da kmh a Nodi(Kts) *\n"); printf("*Digitare 6 per convertire da Nodi(Kts) a mph *\n"); printf("*Digitare 7 per convertire da Mph a Nodi(Kts) *\n"); printf("*Digitare 0 per uscire *\n"); printf("*************************************************\n"); while(1) { scanf("%d",&scelta); if(scelta==7) { while(1) { printf("\nInserire la velocita` in Mph : "); scanf("%f",&y); nodi[0]=1.149537; if(y==0) { printf("MENU PRINCIPALE :"); break; } nodi[1]=y*nodi[0]; printf("La velocita in Nodi(Kts) e` %f",nodi[1]); } } if(scelta==6) { while(1) { printf("\nInserire la velocita` in Nodi(Kts) : "); scanf("%f",&nodi[0]); if(nodi[0]==0) { printf("MENU PRINCIPALE :"); break; } nodi[1]=nodi[0]/1.149537; printf("La velocita in Mph e` %f",nodi[1]); } } if(scelta==5) { while(1) { nodi[0]=1.85; printf("\nInserire la velocita` in Kmh : "); scanf("%f",&x); if(x==0) { printf("MENU PRINCIPALE :"); break; } nodi[1]=x/nodi[0]; printf("La velocita in Nodi(Kts) e` %f",nodi[1]); } } if(scelta==4) { while(1) { printf("\nInserire la velocita` in Nodi(Kts) : "); scanf("%f",&nodi[0]); if(nodi[0]==0) { printf("MENU PRINCIPALE :"); break; } nodi[3]=1.85; nodi[1]=nodi[0]*nodi[3]; printf("La velocita in kmh e` %f",nodi[1]); } } if(scelta==0) { printf("USCITA\n"); /* se scelta e` uguale a 000 esce dal programma */ exit(1); } if(scelta==3) { printf("Nick : kc ; email : \n"); printf("IRC: server channel <#penguin.it> \n"); } if (scelta==1) { while(1){ /* inzio ciclo */ printf ("Inserire la velocita' in Kmh\n"); printf("\nKmh "); scanf("%f",&x); if(x==0) { printf("MENU PRINCIPALE :"); break; } converte=x/1.609344; printf("La velocita' in mph e' %f\n",converte); puts (" " ); } } if (scelta==2) { while(1){ printf("Inserire la velocita' in Mph\n"); printf("\nMph "); scanf("%f",&y); if(y==0) { printf("MENU PRINCIPALE :"); break; } converte=y*1.609344; printf("La velocita' in kmh e' %f\n",converte); puts(""); } } } }