25.06.2013 Views

Il Linguaggio Fortran 90/95

Il Linguaggio Fortran 90/95

Il Linguaggio Fortran 90/95

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.12 Procedure intrinseche 263<br />

costo2=money(15,25) ! 15 euro e 25 cent<br />

anticipo=money(50,0) ! 50 euro<br />

spesa=addmoney(costo1,costo2)<br />

resto=subtractmoney(anticipo,spesa)<br />

WRITE(*,100) "Costo del primo articolo: ", costo1<br />

WRITE(*,110) "Costo del secondo articolo: ", costo2<br />

WRITE(*,120)<br />

WRITE(*,130) "Spesa totale: ", spesa<br />

WRITE(*,140) "Contante versato: ", anticipo<br />

WRITE(*,150)<br />

WRITE(*,160) "Resto ricevuto: ", resto<br />

100 FORMAT(1X,A28,1X,I3,1X,"Euro",1X,I3,1X,"Cent",1X,"+",/)<br />

110 FORMAT(1X,A28,1X,I3,1X,"Euro",1X,I3,1X,"Cent",1X,"=",/)<br />

120 FORMAT(30X,20("-"),/)<br />

130 FORMAT(1X,A26,1X,"-",1X,I3,1X,"Euro",1X,I3,1X,"Cent",1X,"+",/)<br />

140 FORMAT(1X,A28,1X,I3,1X,"Euro",1X,I3,1X,"Cent",1X,"=",/)<br />

150 FORMAT(30X,20("-"),/)<br />

160 FORMAT(1X,A28,1X,I3,1X,"Euro",1X,I3,1X,"Cent")<br />

END PROGRAM prova_moneytype<br />

<strong>Il</strong> risultato prodotto da questo programma è, chiaramente, il seguente:<br />

Costo del primo articolo: 22 Euro 15 Cent +<br />

Costo del secondo articolo: 15 Euro 25 Cent =<br />

--------------------<br />

Spesa totale: - 37 Euro 40 Cent +<br />

Contante versato: 50 Euro 0 Cent =<br />

--------------------<br />

Resto ricevuto: 12 Euro 60 Cent<br />

5.12 Procedure intrinseche<br />

<strong>Il</strong> <strong>Fortran</strong> <strong>90</strong> standard comprende 113 procedure intrinseche progettate allo scopo di risolvere<br />

in maniera efficiente problemi specifici. Esse possono essere raggruppate come:<br />

• Procedure di elemento, a loro volta ripartite in:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!