Help with Fortran: Get Assistance with Programming Assignment

  • Context: Comp Sci 
  • Thread starter Thread starter Kafros
  • Start date Start date
  • Tags Tags
    Fortran
Click For Summary
SUMMARY

The forum discussion centers on troubleshooting a Fortran programming assignment involving the Silverfrost FTN95 Plato3 IDE compiler. The user is attempting to calculate the mean value of a sum of random numbers but encounters issues with the random function. Key points include the need for error trapping for user inputs and clarification on the use of implicit declarations in Fortran. Suggestions emphasize the importance of code documentation and efficient coding practices.

PREREQUISITES
  • Understanding of Fortran programming language
  • Familiarity with Silverfrost FTN95 Plato3 IDE compiler
  • Knowledge of random number generation in programming
  • Basic error handling techniques in programming
NEXT STEPS
  • Research Fortran error trapping techniques for user input validation
  • Learn about the implications of "Implicit none" in Fortran
  • Explore efficient coding practices in Fortran, including the use of vectors
  • Study random number generation and its functions in Fortran
USEFUL FOR

This discussion is beneficial for novice programmers, particularly those learning Fortran, as well as educators and students working on programming assignments that involve random number calculations.

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: 505
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 ?
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 11 ·
Replies
11
Views
6K