introduction to programming - florida state...

Post on 01-Jun-2020

19 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Introduction to Programming

Lecture 1COP 3363 Fall 2019

August 27, 2019

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

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

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

Programming I - Course Information

I Teaching Assistant: Christopher Draper

I Graduate Student

I Research Interests: Random Number Generation

I Other Interests: Games, books, naps

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

Programming I - Course Information

I Teaching Assistant: Yu Miao

I Graduate Student

I Other Interests: food, cooking, swimming

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

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

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

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

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.

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.

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.

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.

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.

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.

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.

Student Expectations

The most common student expectations from the survey

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.

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).

We have technology!

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.

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

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)

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

Programming, and Programming Languages

I Assembly LanguageI translation of machine instructions to symbols, slightly easier

for humans to readI Example: ADD $R1, $R2, $R3

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

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

Software Development

Involves more than just writing code

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

Programming is about Problem Solving

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!

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.”

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

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.

top related