Help with Fortran: Get Assistance with Programming Assignment

  • Context: Comp Sci 
  • Thread starter Thread starter Kafros
  • Start date Start date
  • Tags Tags
    Fortran
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
Kafros
Messages
1
Reaction score
0
help with fortran please

i'm new with programming and i have a problem with a homework I've been assigned from university. it's quite a simple programm but I'm stuck and going crazy . can anyone please help. there seems to be a problem with the random function. but i couldn't fix it. I'm using silverfrost ftn95 plato3 ide compiler. the scope of this programm is to calculate the mean value of a sum of random numbers and as a seed is used a default number. i have attached to this post a pic of what the problem appears to be. take a look please and help me if you can. going crazy
 

Attachments

  • problem.JPG
    problem.JPG
    43 KB · Views: 524
Physics news on Phys.org
Kafros said:
i'm new with programming and i have a problem with a homework I've been assigned from university. it's quite a simple programm but I'm stuck and going crazy . can anyone please help. there seems to be a problem with the random function. but i couldn't fix it. I'm using silverfrost ftn95 plato3 ide compiler. the scope of this programm is to calculate the mean value of a sum of random numbers and as a seed is used a default number. i have attached to this post a pic of what the problem appears to be. take a look please and help me if you can. going crazy

Comments:

* Learn to use comment cards (yes I am that old ;), while it may seem pointless with simple programs it will be of great value in the future (in particular to those looking at your code).
* What happens if the user inputs 5 for N ? You need some error trapping, (i.e. you need to tell them they goofed since N must be between 10 and 100000 and re-request the value of N).
* Is there really a need for a vector (M) and 2 do loops in this program ?
* Since you have declared "Implicit none" how does the compiler to know
(i.e. how do you tell it) that random is a REAL function ?