I\'m very lost for this assignment and don\'t know where tobegin. Somebody plz h
ID: 3617279 • Letter: I
Question
I'm very lost for this assignment and don't know where tobegin. Somebody plz help me with this:Assignment: You will write a simple program that reads in datavalues supplied by the user and finds the largest and smallestnumbers in the data set. The program will then write out thevalues, with the word LARGEST printed by the largest value and theword SMALLEST printed by the smallest value in the data set.
Program Requirements:
Declare a real array with 10 elements to hold the data setvalues
Ask the user for the number of values to be input
If the user tries to input more than 10 values the program musttell the user and then ask for the number of input valuesagain.
The program must employ two functions, one to find the smallestvalue and one to find the largest value
The user input values must be written to the screen and have theappropriate label if applicable.
All program output must be formatted and user input must beformatted if appropriate.
I'm using Force... you can download it here: http://www.lepsch.com/downloads/Force209GFortranSetup.exe For it to work you have to change the compiler optionsto: -g -ffree-form -std=f95 thank you so much for helping me out !
I'm very lost for this assignment and don't know where tobegin. Somebody plz help me with this:
Assignment: You will write a simple program that reads in datavalues supplied by the user and finds the largest and smallestnumbers in the data set. The program will then write out thevalues, with the word LARGEST printed by the largest value and theword SMALLEST printed by the smallest value in the data set.
Program Requirements:
Declare a real array with 10 elements to hold the data setvalues
Ask the user for the number of values to be input
If the user tries to input more than 10 values the program musttell the user and then ask for the number of input valuesagain.
The program must employ two functions, one to find the smallestvalue and one to find the largest value
The user input values must be written to the screen and have theappropriate label if applicable.
All program output must be formatted and user input must beformatted if appropriate.
I'm using Force... you can download it here: http://www.lepsch.com/downloads/Force209GFortranSetup.exe For it to work you have to change the compiler optionsto: -g -ffree-form -std=f95 thank you so much for helping me out !
I'm using Force... you can download it here: http://www.lepsch.com/downloads/Force209GFortranSetup.exe For it to work you have to change the compiler optionsto: -g -ffree-form -std=f95 thank you so much for helping me out !
Explanation / Answer
please rate - thanks best I could do. It's been 25 years and I used fortran 4. hopefully it will get youstarted real a(10) integer num,i write(*,*)"How many numbers do youhave?" read(*,*)num do while(num10) write(*,*)"must be between 1 and 10" write(*,*)"How many numbers do you have?" read(*,*)num end do do i=1,num write(*,*)"enter number: ",i read(*,'(F5.2)')a(i) end do x=small(a,num) write(*,*)"the smallest numberis ",x x=big(a,num) write(*,*)"the biggest numberis ",x CONTAINS real function small(a,num) real a(num) small=a(1) do i=2,num if(a(i)big)big=a(i) end do end function end programRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.