Class Notes (906,005)
CA (538,586)
York (38,198)
EECS (518)
EECS 1540 (3)
all (3)
Lecture

lecture-2 notes .doc

4 Pages
115 Views

Department
Electrical Engineering and Computer Science
Course Code
EECS 1540
Professor
all

This preview shows page 1. Sign up to view the full 4 pages of the document.
CSE 1540.03
Week 2.2 (no Week 2.1) September 14, 2011
Read: Chapter 3 and 4 of the textbook.
Prerequisite for success in Computer Programming:
Donald Knuth (perhaps the world's foremost Computer Scientist) put it
best in a keynote address for the 11th World Computer Congress in
1989:
"What were the lessons I learned from so many years of intensive
work on the practical problem of setting type by computer? One of
the most important lessons, perhaps, is the fact that SOFTWARE IS
HARD. From now on I shall have significantly greater respect for
every successful software tool that I encounter. During the past
decade I was surprised to learn that the writing of programs for TeX
and METAFONT proved to be much more difficult than all other
things I had done (like proving theorems or writing books). The
creation of good software demands a significantly higher standard of
accuracy than those other things do, and it requires a longer attention
span than other intellectual tasks."
Fortran Program Components
Program Units
main program, subprograms (functions, subroutines)
Declaration Statements
provide names and attributes of variables
set aside space
the "buckets"
Executable Statements
Manipulative Statements
- manipulate values of variables (do work):
assignment statements, input, etc.
Control Statements
- determine order in which statements are executed:
repetition, selection
the game of "musical buckets"
Comments
- make program easier to understand for humans
- have NO effect on program or computer
Program Structure
program name
implicit none
declarations
executable statements
end
Example:
program Convert
implicit none
! read Fahrenheit temperature and
! print corresponding Celsius value
real f,c
read*, f
c = 5 * (f - 32) / 9
print*, c
end
CSE 1540 Week 2.2 – September 14, 2011 page 1 of 4

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
CSE 1540.03 Executable Statements Week 2.2 (no Week 2.1) September 14, 2011 Manipulative Statements - manipulate values of variables (do work): assignment statements, input, etc. Control Statements Read: Chapter 3 and 4 of the textbook. - determine order in which statements are executed: repetition, selection Prerequisite for success in Computer Programming: ⇒ the game of "musical buckets" Comments Donald Knuth (perhaps the worldth foremost Computer Scientist) put it - make program easier to understand for humans best in a keynote address for the 11 World Computer Congress in 1989: - have NO effect on program or computer "What were the lessons I learned from so many years of intensive work on the practical problem of setting type by computer? One of Program Structure the most important lessons, perhaps, is the fact that SOFTWARE IS HARD. From now on I shall have significantly greater respect for program name every successful software tool that I encounteDuring the past decade I was surprised to learn that the writing of programs for TeX implicit none and METAFONT proved to be much more difficult than all other declarations things I had done (like proving theorems or writing books). The executable statements creation of good software demands a significantly higher standard of end accuracy than those other things do, and it requires a longer attention span than other intellectual tasks." Example: program Convert implicit none Fortran Program Components ! read Fahrenheit temperature and Program Units ! print corresponding Celsius value main program, subprograms (functions, subroutines) real f,c Declaration Statements read*, f c = 5 * (f - 32) / 9 provide names and attributes of variables set aside space the "buckets" print*, c end CSE 1540 Week 2.2 – September 14, 2011 page 1 of 4 Notes: Example: 1. By convention, lower case is used for everything except named constants, which are in upper case. It is generally accepted that ! This is a long comment lower case looks more attractive. ! which stretches over ! several lines 2. Comments are placed on a separate line. 3. All variables must be declared before the first executable statement. Declarations integer list of variables 4. Fortran 77 is line oriented. (Avoid using the first column.) to continue a line, end the existing line with & and start real list of variables the next line with an &. A separator is a i) space (blank) Notes: ii) tab 1. set aside space in the computer's memory to store data. 2. attach a name to this space. Identifiers (i.e. variable names), keywords, constants, etc. may not contain a separator. Analogy: "buckets" 5. The listing appears as it was entered, so paragraphing is the variable = bucket + label stuck to its front programmer's responsibility. label = identifier (variable name)
More Less
Unlock Document


Only page 1 are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit