introduction to programming - florida state...
TRANSCRIPT
![Page 1: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/1.jpg)
Introduction to Programming
Lecture 1COP 3363 Fall 2019
August 27, 2019
![Page 2: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/2.jpg)
Programming I - Course Information
I Instructor: Sharanya Jayaraman
I Teaching Faculty, PhD Candidate in Computer Science
I Research Interests: High Performance Computing, NumericalMethods, Computer Architecture
I Other Interests: Movies, Food, Spongebob
![Page 3: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/3.jpg)
Programming I - Course Information
I Teaching Assistant: Timothy Barao
I PhD Student
I Research Interests: Machine Learning, Deep Learning, DeeperLearning, Deepest Learning, Malware Analysis
I Other Interests: Movies, Food, Video Games, Scaring ElonMusk with AI Research
![Page 4: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/4.jpg)
Programming I - Course Information
I Teaching Assistant: David Miller
I PhD student
I Research Interests: Manifold Learning, ComputationalGeometry, Topology
I Other Interests: Rock Climbing, PC Games, MechanicalKeyboards
![Page 5: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/5.jpg)
Programming I - Course Information
I Teaching Assistant: Christopher Draper
I Graduate Student
I Research Interests: Random Number Generation
I Other Interests: Games, books, naps
![Page 6: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/6.jpg)
Programming I - Course Information
I Teaching Assistant: Xingang fang
I PhD Student, PhD in Chemistry
I Research Interests: Machine Learning, Deep Learning, BigData, Cheminformatics
I Other Interests: Swimming, Cooking
![Page 7: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/7.jpg)
Programming I - Course Information
I Teaching Assistant: Yu Miao
I Graduate Student
I Other Interests: food, cooking, swimming
![Page 8: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/8.jpg)
Programming I - Course Information
I Teaching Assistant (grader): Alexander No
I Computer Science Senior
I Research Interests: Natural Language Processing,Knowledge-based AI
I Other Interests: memes, games
![Page 9: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/9.jpg)
Programming I - Course Information
I Teaching Assistant (grader): Phat Thanh Tran
I Computer Science SeniorI Interests: Machine Learning, beatbox, work out, and Fire
EmblemI Fun facts: My fast food name is Eric
![Page 10: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/10.jpg)
Programming I - Course Information
I Teaching Assistant (grader): Jeremiah Cummings
I Computer Science Senior
I Interests: Sailing, music
I Fun facts: Has walked all around fSU campus
![Page 11: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/11.jpg)
Course Expectations
This is a hard class
I While this class is required for CS majors. It is also anintroductory class.
I It is back heavy, so a lot of homeworks will be due towardsthe end of the course.
I You have signed up to learn programming in C++. At theend of the course, you should be a competent entry-levelC++ programmer.
I However, this involves a lot of
![Page 12: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/12.jpg)
Course Expectations
Effort!
I Programming is a skill. Almost anyone can be trained to do itwell.
I You need to devote time outside class to practice. Practice isthe only way to better yourself as a programmer.
![Page 13: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/13.jpg)
Course Expectations
Reading
I Please read through the entire write-up a couple of times tounderstand the requirements before asking questions.
I Most of the assignments/ problem statements will be long.Jumping the gun without reading the whole thing could bedetrimental.
![Page 14: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/14.jpg)
Course Expectations
Basic Arithmetic
I You will not be allowed calculators for the test. However, youwill be expected to do some very basic math operations onyour tests.
I You are being forewarned. Math is not scary.
![Page 15: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/15.jpg)
Course Expectations
Start Early!
I You will be given a week to 10 days for homeworks. Pleasestart early. You need that amount of time to complete them.
![Page 16: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/16.jpg)
Course Expectations
Attendance
I The class is very incremental. So, skipping a few classes willget you into trouble. You are expected to attend class.
I While we understand that sometimes, circumstances result inmissing a couple of classes, missing quite a few classes is notcondoned.
![Page 17: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/17.jpg)
Course Expectations
Retention
I The class is very incremental. Material introduced in one classwill be applied through the rest of the course. Retainingmaterial is important. There is no modularization of material.
I Please make sure you understand a concept before we moveon to the next. We are ok with repeating material.
![Page 18: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/18.jpg)
Course Expectations
Ask for help!
I The instructor and the TA’s are available to help. Please donot hesitate to ask for help.
I We are willing to work with you to ensure you are learning thematerial. However, this requires that you start theassignments early.
![Page 19: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/19.jpg)
Student Expectations
The most common student expectations from the survey
![Page 20: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/20.jpg)
Academic Honor Code
I Of late, we have been having a lot of issues with violations ofthe Academic Honor Code.
I Since this is your first programming class, the rules might be abit ambiguous. We will try to clear up any confusion here.
I What is allowed:I Asking the instructor of TA for helpI Discussing concepts in general, discussing the concepts used in
an assignment.I Getting a tutor to help you with concepts and ideas.
I If you have a question about what counts as a violation to thehonor code, please ask the instructor or the TA’s.
![Page 21: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/21.jpg)
Academic Honor Code
This is a list (inexhaustive) of things that violate the AcademicHonor Code
I Copying another person’s solution (changing variable nameswon’t help).
I Giving another person your solution.
I Telling another person how to solve the problem.
I Hiring a tutor to solve the problem for you.
I Asking friends/family to solve the problem for you.
I Copying solutions from the internet.
I Hiring people on the Internet (including websites like chegg)to solve the problem for you.
I Turning in older solutions if you’re repeating the class.
I Working with another student (collaboration).
![Page 22: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/22.jpg)
We have technology!
![Page 23: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/23.jpg)
Main Components of a computer
I CPU - Central Processing Unit: The “brain” of the computer.I ISA - Instruction Set Architecture: the specific set of low-level
instructions available to a CPU. Differs for various CPU types(Intel Pentium, Mac G4, etc).
I ALU - Arithmetic & Logic Unit responsible for performingarithmetic calculations, as well as logical operations(comparisons for equality, inequality, for instance).
I Main Memory (RAM - Random Access Memory).I storage close to CPUI Faster to access than hard diskI stores executing programs and data being currently worked on
I Secondary MemoryI SSD, hard disk, DVD, etc.
![Page 24: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/24.jpg)
Main Components of a computer
I Input devicesI mouse, keyboard, scanner, network card, etc.
I Output devicesI screen/console, printer, network card, etc.
I Operating SystemI Examples: Mac OS, Windows 10, LinuxI Controls computer operationsI Manages allocation of resources for currently running
applications
![Page 25: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/25.jpg)
Memory Concepts
I bit: a binary digitI Stores the value 0 or 1I Smallest unit of storage in a computer
I byte: 8 bitsI Smallest addressable unit of storage in a computerI Storage units (variables) in a program are 1 or more bytesI Each byte in memory has an address (a number that identifies
the location)
![Page 26: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/26.jpg)
Programming, and Programming Languages
Program - a set of instructions for a computer to execute
Evolution of Programming languagesI Machine Language
I Based on machine’s core instruction setI Needed by computer, hard for humans to read (1’s and 0’s)I Example: 1110110101010110001101010
![Page 27: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/27.jpg)
Programming, and Programming Languages
I Assembly LanguageI translation of machine instructions to symbols, slightly easier
for humans to readI Example: ADD $R1, $R2, $R3
![Page 28: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/28.jpg)
Programming, and Programming Languages
I High-level procedural languagesI Abstraction of concepts into more human-readable termsI Closer to ”natural language” (i.e. what we speak)I Easy to write and design, but must be translated for computerI Examples include C, Pascal, Fortran
I Object-oriented languagesI Abstraction taken farther than procedural languagesI Objects model real-world objects, not only storing data
(attributes), but having inherent behaviors (operations,functions)
I Easier to design and write good, portable, maintainable codeI Examples include Smalltalk, C++, Java
![Page 29: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/29.jpg)
Code Translation
Bridging the gap between high-level code and machine code
I Interpreted languages – source code is directly run on aninterpreter, a program that runs the code statements
I Compiled LanguagesI A compiler program translates source code (what the
programmer writes) to machine language (object code)I A linker program puts various object code files together into an
executable program (or other target type, like a DLL)I C and C++ are compiled languages
![Page 30: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/30.jpg)
Software Development
Involves more than just writing code
![Page 31: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/31.jpg)
Software Development
I Analysis and problem definition
I Design - includes design of program or system structure,algorithms, user-interfaces, and more
I Implementation (coding)
I Testing - can be done during design, during implementation,and after implementation
I Maintenance - usually the major cost of a software system.Not part of ”development”, but definitely part of the softwarelife cycle
![Page 32: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/32.jpg)
Programming is about Problem Solving
![Page 33: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/33.jpg)
Programming is about Problem Solving
I Algorithm - a finite sequence of steps to perform a specifictask
I To solve a problem, you have to come up with the necessarystep-by-step process before you can code it
I This is often the trickiest part of programming
I Some useful tools and techniques for formulating an algorithm
I Top-down Refinement: Decomposing a task into smaller andsimpler steps, then breaking down each step into smaller steps,etc
I Pseudocode: Writing algorithms informally in a mixture ofnatural language and general types of code statements
I Flowcharting: If you can visualize it, it’s often easier to followand understand!
![Page 34: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/34.jpg)
Programming is about Problem Solving
I Testing - algorithms must also be tested!I Does it do what is required?I Does it handle all possible situations?
I Syntax vs. SemanticsI Syntax – the grammar of a language.
A syntax error: ”I is a programmer.”I Semantics – the meaning of language constructs
Correct syntax, but a semantic error: ”The headphones ate thetree.”
![Page 35: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/35.jpg)
Basic Creation and Execution of a C++ program
I Create source code with a text editor, store to disk.I Source code is just a plain text file, usually given a filename
extension to identify the programming language (like .c for C,or .cpp for C++)
I Preprocessor – Part of compiler process, performs anypre-processing tasks on source code.
I Compilation – syntax checking, creation of object code.I Object code is the machine code translation of the source code.
I Linking – Final stage of the creation of an executableprogram. Linking of object code files together with anynecessary libraries (also already compiled).
I Execution of programI Program loaded into memory, usually RAMI CPU executes code instructions
![Page 36: Introduction to Programming - Florida State Universityjayarama/introfa19/Slides/Intro.pdfIntroduction to Programming Lecture 1 COP 3363 Fall 2019 August 27, 2019. Programming I - Course](https://reader030.vdocument.in/reader030/viewer/2022040612/5edcf04cad6a402d6667d5eb/html5/thumbnails/36.jpg)
Software Required for the Class
I This class uses a Unix programming environment.I You will need a CS account. You can get one here: https:
//system.cs.fsu.edu/newuser/cs-account-setup/I If you have a Mac, you already have the terminal installed.
You might want to install an SFTP client like cyberduck(https://cyberduck.io/)
I If you have a Windows machine, you need to install the TectiaSSH client, which also includes an SFTP client. You can get itfrom the CS systems Group page(https://system.cs.fsu.edu/newuser/ssh-how-to/)
I Once you have this, connect to linprog.cs.fsu.edu using yourCS Username and Password.
I You can also use CLion, XCode, Visual Studio, etc. However,if you do so, please keep in mind that the TA’s will use linprogto grade.