Question: Fortran Language Write a Fortran program that makes change. Input a number from 1 to 99 that is the number of cents US. Output the
Fortran Language Write a Fortran program that makes change. Input a number from 1 to 99 that is the number of cents US. Output the most of the biggest coins to equal the input number. 1 Dollar = 100 cents 1 Quarter = 25 cents 1 Dime = 10 cents 1 Nickel = 5 cents 1 Penny = 1 cent Read from keyboard, write to screen Do not print out coin if none (zero) are needed Starter code can be copied from make_change.f90 Test on 99, 90, 76, 75, 74, 55, 41, 30, 25, 10, 5, 1 Then test on bad data -99, -1, 0, 100, 1000 abc 7.7 The output should look like this for input 41 1 Quarter 1 Dime 1 Nickel 1 Penny The output should look like this for input 76 3 Quarter 1 Penny Problem 1a Make change using non advancing write Modify Problem 1 to use non advancing write Put all the results on one line, again do not print zero values Same test data The output should look like this for input 41 1 Quarter 1 Dime 1 Nickel 1 Penny The output should look like this for input 76 3 Quarter 1 Penny Problem 1b Make change using input from a disk file Replace the read statement with a modified read statement that reads from a disk file. Create a file make_change.dat Put the test data from Problem 1 into this file, one item per line, the good data followed by the bad data, put 99 at the end to be sure your program read all the data
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
