--%>

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 : Partners-firm and firms name What do

    What do you understand by the terms partners, firm and firms name? Answer: The persons who have entered into a Partnership with each other are individually termed 'P

  • Q : The provision of management accounting

    explain how the provision of management accounting information can assist the management of a company with planning, controlling, decision making and communicating

  • Q : Define Employee Stock Ownership

    Employee Stock Ownership: It is a qualified, defined contribution, employee benefit (that is, ERISA) plan designed to invest mainly in the stock of sponsoring employer. ESOPs are "qualified" in the logic that the ESOP's sponsoring company, the selling

  • Q : Cash flows from operating activities

    The first section of the statement of cash-flow. Cash flows from operating activities include transactions (involving cash) that relate to the normal busi- ness activities of the entity. Cash-flows in this section usually involve cash and other current asset or curren

  • Q : Determining costs and benefits in

    Write down a short note on determining costs and benefits in decision making process?

  • Q : Why most of the larger businesses are

    Why most of the larger businesses are not managed as the single unit through one manager?

  • Q : Liability of partners Liability of

    Liability of partners: A) Under contract law: Liability is joint only (collectively); The creditor has only one right of action (except in NSW, where liability is now joint and several).

  • 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 : Define Investor Relations Investor

    Investor Relations: A department, exist in most medium to big public companies, which gives investors with a precise account of the company's affairs. This aids investors to make informed sell or buy decisions. Inv

  • Q : Reliability-Accounting information What

    What do you mean by the term Reliability which is accounting information?