--%>

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 : Describe fluctuating capital of partners

    Describe fluctuating capital of partners? Answer: Partner‘s capital is stated to be fluctuating if capital modifies with every transaction in the capital accou

  • Q : Insurance premium in Arrears What are

    What are the Insurance premium in Arrears?

  • Q : Management Accounting Project Please

    Please let me know the cost of getting this assignment completed?

  • Q : Ravenna Please see attached. Do tutors

    Please see attached. Do tutors provide assistance as to how they came about their answers?

  • Q : Define Expense Expense : The Outflow or

    Expense: The Outflow or other using up of resources or acquiring liabilities (or a combination of both), the advantages from which exert to an entity's operations for the present accounting period, however they do not expand to future

  • Q : Main working areas of the coach

    Write a short note on the main working areas of the coach maintenance department?

  • Q : Capital expenditure Expenditure that

    Expenditure that increases the dollar amount of fixed assets on the balance sheet. These outlays either increase the value of assets already owned or add additional assets. The payments increase the future benefit of an asset by extending the life of the asset, increa

  • Q : Define Actual Cost Actual Cost : It is

    Actual Cost: It is the amount (sum) determined on the basis of cost acquired involving standard cost appropriately adjusted for the applicable variance.

  • Q : Federal budget Choose the right answer

    Choose the right answer from following. Which one did not contribute to the large Federal budget deficits in the year of 2002 and 2003? A) spending on the wars in Afghanistan and Iraq. B) low interest rates. C) Federal tax cuts. D) the recession of 2001 and its afterm

  • Q : Define Capital Budgets Capital Budgets

    Capital Budgets: The procedure of finding out which potential long-term projects are value undertaking, by comparing their estimated discounted cash flows with their internal rates of return. Capital Budget is the