--%>

Basic Fortran Project

Fortran Project

This is our last project of the semester. You have freedom to code anyway you like, but make sure to meet the minimum project requirements.  Any changes, notes, or additions to this specification will be made here or on the class site and you will be notified via email of such.

studentRecords.dat (available on site)

This project will use a posted file named studentRecords.dat.  This file has the following format:

For example, here are the first few lines from the file:

Julia       Tubs                       28978    ECON    3.8636613            116

Lois        Foley                      14420     ENGL     1.9225476            58

James   Smith                       10413     ENGL     1.3883250            42

Patrick  MaGuirk                    3995       EECS      0.5326414            1

To read in or write all the attributes from a single line you will have to remember that no more than 132 characters can be on one line of code.  So you will to use the & to continue the writing to the next line.

Example READ to an array of students:

OPEN(FILE="studentRecords.dat", UNIT=1, STATUS="OLD")

TYPE(STUDENT), DIMENSION(50) :: students

DO i=1, SIZE(students), 1

READ (1,*) students(i)%firstName, students(i)%lastName, &

students(i)%stuID, students(i)%dept, & students(i)%gpa, &

      students(i)%credits

END DO

Example PRINT:

DO i=1, SIZE(students), 1

PRINT *, students(i)%firstName, students(i)%lastName, &

students(i)%stuID, students(i)%dept, & students(i)%gpa, &

      students(i)%credits

END DO

Please note the above examples are reading and print a single line from/to a single variable of TYPE(STUDENT). In the driver you will need to modify this for an array.

studentModule.f90

MInimum requirements:

Name the module studentMod

Create a new type called STUDENT with the following attributes

  1. CHARACTER(10)  named firstName
  2. CHARACTER(10)  named lastName
  3. INTEGER named stuID
  4. CHARACTER(4) named dept
  5. REAL named gpa
  6. INTEGER name credits

Required Subroutines

1    sortByLastName( students )

a)      students is the array of students and will be INTENT(INOUT)

b)      students is sorted by the last name in ascending order

2   sortByGPA( students )

a)      students is the array of students and will be INTENT(INOUT)

b)      students is sorted by the GPA in descending order

3  sortByCredits( students  )

a)      students is the array of students and will be INTENT(INOUT)

b)      students is sorted by the credits in descending order

Studentdriver.f90

Minimum Requirements:

You are free to declare as many variables as you want and set things up to your liking, but the driver must:

1   Write all students in alphabetical order by their last names to a file named "alphetize.dat"

2   Write the top 10 students (the 10 largest gpa's) to a file named "topTen.dat"

3   Print all student names to the screen in alphabetical order.

4   Prompt the user for a minimum number of credits and write all students who have more credits the number specified by the user to a file named "creditChoice.dat"

5   Prompt the user for a letter and write all students whose first name starts with that letter to a file name "letterChoice.dat"

6   Prompt the user for a student id then print all the information you have for the student with that student id to the screen

7   Print the student lowest  gpa to the screen

8   Print the student highest gpa to the screen

9   Print the average gpa (across all students) to the screen

10  Print the average number of credits (across all students) to the screen

11  Print the department name with the most students

Important notes:

1    When I say "print the student" or "write the student" I require you to print/write all the information regarding that student (first name, last name, dept, id, gpa, credits)

2   When you write or print preserve the original order from studentRecords.dat

3   

CircleType.f90

Name the module circleType

You may use your point module from project 3.

Create a new type called CIRCLE with the following attributes

1             TYPE(POINT) named center

2             REAL named radius

Required Functions

1 distBetweenCircles(c1, c2)

a c1 and c2 are circles

b returns the distance between the centers of c1 and c2

2 intersect( c1, c2)

a c1 and c2 are circles

b returns true if the distance between the centers of c1 and c2 is less than the sum of their radii (modified 2012.12.05)

3 area( c )

a c is a circle

b returns the area of the circle, c

i recall Area of a circle is pi * radius2

ii use 3.14159 as an approximation for pi

Required Subroutines

1 storeCircles( array, fileNum, fileName, fileStatus)

a array is an array of type CIRCLE of an unknown DIMENSION and is INTENT(INOUT)

b fileNum is and INTEGER representing the UNIT of the file holding the circle information

c fileName is CHARACTER of unknown length

d fileStatus is CHARACTER of unknown length

e This subroutine will open the file given

f Reads in as many circles as SIZE( array ) will allow

g We'll discuss this function later and in class

2 printIntersections( circles )

a circles is an array of circles

b prints the indexes of any circles that intersect

c sample output as seen from the circleAnalyzer.f90

3 printAreas( circles )

a circles is an array of circles

b prints the area of all circles to the screen

c sample output as seen from the circleAnalyzer.f90

CircleAnalyzer.f90

Use the circleType module to perform the following:

1 Obtain a number from the user indicating how many circles to retrieve from the file (max of 50)

a if the user gives a number under 1, then force their number to 1

b if the user gives a number over 50, then force their number to be 50

2 Print a list of all intersecting circles

3 Print a list of all circle areas

   Related Questions in Managerial Accounting

  • Q : Cash budget A plan for the cash coming

    A plan for the cash coming into and going out of a business. Based on the sale forecast,  the timing and amounts of  cash receipts. Based on forecast of resources necessary to  meet the sale forecast, management budgets the cash disbursements. This proc

  • Q : Explain Dissolution 1) Dissolution ENDS

    1) Dissolution ENDS the partnership. a) Action of the parties: • By the expiration of a fixed term;• If entered

  • Q : Explain Standard Costing Standard

    Standard Costing: A costing technique which joins costs to cost objects based on reasonable approximations or cost studies and by the means of budgeted rates instead of according to actual costs incurred. The predictable cost of gener

  • Q : Determine & Analysis on Income

    The DU Inn The DU Inn is an 80-room hotel located on some mountaintop in Colorado. That has no bar or restaurant &is positioned as a mid-priced, good quality "homey" hotel.  It is open only during

  • Q : Adjunct account An account in financial

      An account in financial reporting that increases the book value of a liability account. An adjunct account is a valuable account from which cred

  • Q : Selecting strategic options and

    Write a short note on selecting strategic options and formulating the plans?

  • Q : Calculate From the books of Aggarwal

    From the books of Aggarwal Bors, the following information have been extracted: Rs. Sales 2,40,000 Variable costs 1,44,000 Fixed costs 26,000 Profit before tax 70,000 Rate of tax 40% The firm is proposing to buy a new plant which can generate additional annual profit of Rs. 10,000. The fixed

  • Q : Threats to business comprises Write a

    Write a brief note on the things which Threats to business comprises?

  • Q : Explain Cost Assignment Cost Assignment

    Cost Assignment: A procedure which identifies costs with activities, outputs, or another cost objects. In a wide sense, costs can be assigned to activities, processes, products, organizational divisions, and services. There are three

  • Q : Explain Cash Management Cash Management

    Cash Management: Cash Management is the management of cash balances of a concern in such a way as to maximize the accessibility of cash not invested in inventories or fixed assets and to ignore the risk of insolvency. According to Keynes there are thr