Write a fortan program that takes a certain amount of money
Solution
Fortan Program
It is impossible to have 19 coins of the same type that equal one dollar.
3 pennies = $1.68+$1.68+$1.68=$3.48
1 nickels = $1.68
,6 quarters=$1.68+$1.68+$1.68+$1.68+$1.68+$1.68=$6.88
1 dem= $1.68
1 dimes = $1.68 (too big so quarters and half dollars are also eliminated)
DollAR=$1.68 % Input of the program
3 pennies = $1.68+$1.68+$1.68=$3.48
1 nickels = $1.68
,6 quarters=$1.68+$1.68+$1.68+$1.68+$1.68+$1.68=$6.88
1 dem= $1.68
Money=6 quarters+1 dime+1 nickel+3 pennies
print* * \"Money\"
DollAR=$1.68 dividing the coins
print* * \"$1=idem\"
end program
A Fortran program reads from standard input or from a file using the read statement, and it can write to standard output using the print statement. With the write statement one can write to standard output or to a file. Before writing to a file, the file must be opened and assigned a unit number with which the programmer may reference the file. If one wishes to use the write statement to write a statement to the default output, the syntax is write(*,*). It is used as follows:
Example
