cs 2130 lecture 2 academic misconduct more overview & history some c stuff

29
CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Upload: hillary-barton

Post on 18-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

CS 2130

Lecture 2

Academic Misconduct

More Overview & History

Some C Stuff

Page 2: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Policy Reminders

• No Cell phones/Beepers/Alarms• Be considerate of others. Be on time.• No whispering• Buzzcard required to take exams• Policies posted on:

– Class newsgroups

git.cc.class.cs2130.announce– Class Co-Web

http://swiki.cc.gatech.edu:8080/cs2130

Page 3: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

New Institute Policies!

Effective Fall semester, 2001• Graduating seniors take the final exam during finals

week• Mid-semester grade reports for all 1000 and 2000

level classes– Satisfactory/Unsatisfactory grade (non-binding)– Issued after Fall Break (on or about Oct 17)

• After Drop Day!

– Students with unsatisfactory performance will be encouraged to meet with TA or Instructor

Page 4: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Honesty

It is expected that (unless specific instructions to the contrary are given) all student submissions will be individual efforts.

All required coursework that is submitted for evaluation in this academic course becomes the property of the Georgia Institute of Technology, and is subject to review for evidence of academic misconduct. If such evidence is discovered, then the offending students will be referred to the Dean of Students for investigation.

Page 5: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Misconduct

Section XVIII.C. of the Student Rules and Regulations defines academic misconduct as "any act that does or could improperly distort student grades or other student records."

Among the list of items that are cited in this section are the following:

Page 6: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Misconduct

1. Possessing, using or exchanging improperly acquired written or verbal information in the preparation of an essay, laboratory report, examination, or other assignment included in the academic course.

3. Submission of material that is wholly or substantially identical to that created or published by another person or persons, without adequate credit notations indicating the authorship (plagiarism).

Page 7: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Honesty

In layman's terms, this means that if any student receives or provides any information that would enable himself/herself or any other person to complete an assignment or examination that is not wholly the work of the person submitting that assignment or examination, then that student is in violation of the academic honor code of Georgia Tech. This includes copying published material from any source, whether written or electronic.

Page 8: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Honesty

To prevent problems in this area, make sure that all assignment solutions that you submit are properly cited (this includes homeworks). If you copied the answer from a book ("any" book), then cite it. If you got the information from a web page, then cite it. If you got it from your class notes, then cite it. As long as appropriate citations are given, then the worst thing that will happen to you if you copy from an "unapproved" source is that you will get a 0 (ZERO) on the assignment. If you copy material and do not cite it, then you will be reported to the Dean of Students on suspicion of academic misconduct.

Page 9: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Academic Honesty

Any such incidents will be dealt with accordingly, and penalties for conviction can be severe - up to and including notice of academic misconduct on a transcript, failure in the academic course, expulsion from the College of Computing, expulsion from Georgia Tech, and community service.

Page 10: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Tests

• Tentative Dates on Syllabus (i.e. subject to change, but they usually don't)

• Test 0: Thursday, September 20, 2001• Test 1: Thursday, November 8, 2001• Final Exam: TBA

• Graduating Seniors must take the Final Exam!

Page 11: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Languages & Translation

• Natural Languages– English

– French

– Russian

– Japanese

– Esperanto

• Very complex rules of grammar

• Often ambiguous• Usually tied to speech• Constantly evolving• Often very context sensitive

• Computer Languages– Assembler

– Fortran, Cobol, Basic

– C, Ada, Forth

– Lisp, Scheme, SML

– Prolog

– Smalltalk, C++, Java

• Grammars more structured than natural languages

• Precise?• Not often spoken• Fixed by version/standard• Context free?

Page 12: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Languages & Translation

• Converting one language into another

• We will deal with translation of computer languages

• Why do we need translation?– Efficiency– Abstraction (Want to write in HLL)

Page 13: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

A Little History

• Beginnings (30's and 40's)– Theoretical Foundations of Computer Science

• Turing, Godel, Church, Markov, Post, Kleene

– Binary logic/Idea of algorithms– First electronic computers in 40's– Programming by wiring then machine language

• Development of Programming (50's)– Symbolic names– Assemblers

• High Level Languages (60's)– High Level Languages (e.g. Fortran/Cobol)– Data structures/Parameters– Transportability?/Program as assembly of parts

C70600000002

MOV X,2

X = 2

Page 14: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

A Little More History

• Program Size & Complexity Increasing (70's)– C and Pascal– Recursion and Dynamic Memory

• Interactivity/Timesharing (80's)– Software Engineering– Object Oriented Approach: Smalltalk & C++

• Network Prominance (90's)– Internet/www– Separate compilation– Java

• Next???

Page 15: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Translation by any other name...

• Compiler– Translates program written in "source" language to "target"

language

• Interpreter– Translate and immediately execute

• Assembler– Translate into machine language for particular machine

• Macro Processor– Textual substitutions

Page 16: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Compilers

• Fortran– .for .obj .exe

• C– .c .o a.out

• Java– .java .class

• Compilation often used for speed and efficiency of executable code

Page 17: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Interpreters• Emulators

• Basic– Beginner's All-purpose Symbolic Instruction Code

• Lisp

• Scheme

• Java Virtual Machine

• Interpreters often used for educational/rapid prototyping and portability in the case of Java

Page 18: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Assemblers

• Typically processor/machine specific

• Some compilers produce assembly code

• Very close tie to hardware

• Symbolic version of machine language

• Still used for speed/size in performance critical apps

• Needlepoint for nerds?

Page 19: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Macro Processors

• C Preprocessor– Performs many useful tasks before "actual" compilation

begins– Macro substitutions

• C++– Initially preprocessor translated C++ program into C

program

• m4– UNIX macro processor– Nobody understands how to use it

Page 20: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Other Items?

• Linkers• Loaders• Editors• Debuggers• Profilers• Project Managers

• Instant Messengers• Quake• Jolt/Surge/etc.

Page 21: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

C Programming

• 5 Weeks

• Not a C Programming course

• Focus on using for translation

• C as translation target– Course designed to be taken at same time as ECE 2030

Page 22: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

C Review?

• BCPL (Typeless) - 1967 - Operating Systems• B - Ken Thompson - First version of Unix• C - 1972 - Dennis Ritchie - Implemented on PDP-11• Unix rewritten in C in 1974• Publication of "The C Programming Language" by

Brian Kernighan and Dennis Ritchie• ...• ANSI C (1989)

– Major updates to C standard in 1994 and 1999– We will use C89 in CS 2130 (GNU C compiler)

Page 23: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

C Stuff

• C Programs generally consist of one or more functions– Execution starts in a function called main

• Arrays– Start at 0– No bounds checking

• Strings– There are no strings...more later!

• Structures– Like records (or objects where all members are public)

• Pointers– Variable containing an address or location

Page 24: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

More C Stuff

• Comments /* */

• Types– Character

– Integers• Warning: Hex constants...Octal Constants

• Long and Short

• Signed and Unsigned

– Floating Point

• Sizeofsizeof(int) /* sizeof a type */

sizeof x /* sizeof a data object */

Page 25: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Expressions

• A constant or variable by itself is an expression

• Combinations of constants and variables with operators are also expressions

• Examples

7 /* Constant */

x /* Variable */

x + 7 /* with operator */

x = x + 7 /* with operators */

x = x + 7; /* Simple statement */

Page 26: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Operators

= Assignment Operator: Evaluate expression on right, store result in variable on the left

+= Add value on right side to variable on left side

-= Subtract value on right side from variable on left side

*= Multiply variable on left side by value on right side

• Assignment expression itself has a value!

a = b = c = 0;

Page 27: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Other Operators

• Binary Arithmetic + - * / %• Unary + - ++ --• Bitwise << >> ~ & | ^• Relational < <= => > == !=• Logical && || !

Pretty much the same as Java except there is no boolean value

Page 28: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff

Questions?

Page 29: CS 2130 Lecture 2 Academic Misconduct More Overview & History Some C Stuff