- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to read an equation of the type : (15**2-D**2)**0.5 with the variable D, with the command READ(7,*)C and it gives me an error message.Do i have to state thatD is a variable???how???Any ideas?It is kind of urgent , because i have to deliver my homework at school...
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just discovered this accidentally posted to the archive board (which was supposed to be read-only, but wasn't.) Adding this reply so that people see it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Homework, um? If it's a programming homework, this is definitely not a job for a newbie. The problem is that you any formula you want tocalculate must be seen by compiler at compile-time. If you want to enter a formula in run-time, you must parse it yourself, i.e. read the formula as a character string, analyse the string (whether any substring is a variable, operator (+,-,*,bracket) or number), break it into elementary operations and calculate each intermediate result yourself.
You can find the program which does exactly that here:
http://smidgley.customer.netspace.net.au/fortran/
but I somehow doubt that this was really your assignment :smileywink:.
Jugoslav

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page