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 : Define Cost Accounting Cost Accounting

    Cost Accounting: The Cost accounting is an approach to evaluate the overall costs which are related with conducting business. It is generally based on standard accounting practices, cost accounting is one of the tools which managers u

  • Q : What is Limited partnerships Limited

    Limited partnerships: Limited partnerships are an alternative to limited liability companies because of their simplicity. All the states encompass passed limited partnership legislation.A limited partn

  • Q : What is Variable Cost Variable Cost : A

    Variable Cost: A cost which differs with changes in the level of an activity, whenever the other factors are held constant. The cost of material treating to an activity, for illustration, differs according to the number of material de

  • Q : Management accounting According to

    According to Martin and Steele (2010, p.13), “The two principal professional associations in Australia – CPA Australia (the CPA) and the Institute of Chartered Accountants in Australia (the Institute) have indicated their awareness of the significance of issues of sustainability reporting and develo

  • Q : VAT entry How to make a VAT entry in

    How to make a VAT entry in books including set off?

  • 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 : Explain Full-Absorption Costing

    Full-Absorption Costing: It is a technique of costing that assigns (or absorbs) all labor, material, and service or manufacturing facilities and support costs to products or another cost objects. The costs assigned comprise those which do and do not d

  • Q : Explain Managerial Cost Accounting

    Managerial Cost Accounting System: The organization and processes, whether automated or not, and whether portion of the general ledger or stand-alone, which accumulates and reports constant and trustworthy cost information and perform

  • Q : Define Differential Cost Differential

    Differential Cost: The cost difference predicted when one course of action is adopted rather than others.

  • Q : Avoidable interest The amount of

      The amount of interest that an organization would have avoided if it had not made the expenditures for an asset. Avoidable interest is calculated when an entity is self- constructing an asset. The cost of the asset can include material, labor, and overhead plus some interest. The c

©TutorsGlobe All rights reserved 2022-2023.