CSCE150 Fortran Lab 6 exam1 - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

CSCE150 Fortran Lab 6 exam1

Description:

Show me how to compile and run your program (5 points) ... 5 points for compiling successfully. 10 bonus points: finish within 30 mins (must compile successfully) ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 5
Provided by: cse92
Category:

less

Transcript and Presenter's Notes

Title: CSCE150 Fortran Lab 6 exam1


1
CSCE150 Fortran Lab 6 exam1
2
Question (40 points)
  • Write a Fortran program to determine whether a
    year (four digits, for example 1999) is a leap
    year or not.
  • the year is inputted by the user
  • check whether this year is a leap year or not,
    and print this is a leap year or this is not a
    leap year to the user
  • the program continuously accepts user inputs
    until 0 is inputted to terminal the test (the
    user should be able to test more than one year
    without run the program again)

3
requirements
  • Show me your comments (5 points)
  • Show me how to compile and run your program (5
    points)
  • Show me your test cases (5 points for each case)
  • 1 1600 gt this is a leap year
  • 2 2008 gt this is a leap year
  • 3 1900 gt this is not a leap year
  • 4 1993 gt this is not a leap year
  • 5 points for an honest effort to code
  • 5 points for compiling successfully
  • 10 bonus points finish within 30 mins (must
    compile successfully)
  • 5 bonus points finish within 50 mins (must
    compile successfully)

4
hints
  • Leap year rules
  • if a year is divisible by 400
  • or
  • if a year is not divisible by 100, but divisible
    by 4
  • http//en.wikipedia.org/wiki/Leap_year
  • Intrinsic function MOD
  • example MOD(year,400)0
  • page 735 of old textbook, page 886 of new textbook
Write a Comment
User Comments (0)
About PowerShow.com