Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-07-2011, 10:59 PM   PM User | #1
rustydog123
New to the CF scene

 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rustydog123 is an unknown quantity at this point
Fortran Programming Help

I am getting hung up on this program, could someone please help me out.
Thanks

Input contains data on annual rainfall for several cities. Each line contains the name of the city (in columns 1 through 30) followed by the rainfall in inches (to two decimal places) in columns 32 through 37. The end is marked by the fake city zzzz.

The program will print the number of cities processed and the overall average (to two decimal place. Then it will print a table listing each city's name, rainfall amount, and its classification (dry, normal, or wet). A city with rainfall less than 15 percent of the overall average is considered dry, one with more than 2.5 times the average is considered wet, the rest are normal. The output should look like the outline below.

... Cities processed
Overall Average: ......

City Annual Rainfall Category
......... ...... .....
......... ...... .....

You must define and use the Subs FillLists and PrintTable and the functions
Average() [returns the average of the N numbers in the given array] and Category(rainfall, avg) [given a rainfall number, and the overall average, returns the corresponding category.

In reading the data on each city, you will need formatted READ (the city name may be more than one word as in Grand Rapids. Recall that this is done as follows.
READ (*,100) ..., ... ! the two vars for name of city and rainfall
100 FORMAT(A30, 2X, F6.2)
rustydog123 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:31 PM.


Advertisement
Log in to turn off these ads.