CMPT-101. CMPT-101-D2, Spring Course Web Page Course Mailing List. Exams. Assignments
|
|
- Kathleen Atkins
- 5 years ago
- Views:
Transcription
1 CMPT-101 CMPT-101-D2, Spring 2000 Week 1, Introduction Instructor: Toby Donaldson An introduction to programming and computer science Covers the basic ideas used in (most) major general-purpose programming languages 1 2 Course Web Page The cmpt-101 web page is the main source of information Course outline and schedule Assignments posted there Two important things to do right away: Learn how to download and read PDF files Print and read Russ Tront s guide to Borland C++ (it's a PDF file!) 3 Course Mailing List You are all automatically added to an electronic mailing list Only me and the TAs can send to it The list is archived on the web page Important information (e.g. corrections to assignments) will be posted here Read your regularly! 4 Assignments 5 individual programming assignments 1 project, in teams of up to 3 people Deadlines are strict: no individual extensions computers always seem to crash at the worst possible time, so aim to be finished 2 days before the deadline 5 Exams Exams will be open book You may use the textbook, your notes, or any other reference materials --- even your own brain!! But no electronic devices! Midterm: Wednesday, Feb. 23 (in class, 50 minutes) Final exam: Monday, April 19, 3:30pm 6:30pm (location TBA, 3 hours) 6
2 Two Sections This is CMPT-101-D2 You are the morning section There is also an afternoon section You are not the afternoon section! You must write the proper exams! Different sections have different exams! But assignments are all the same Are the Lectures the Same? Not in minute to minute detail, but the same schedule will be followed You should attend the lecture for the section you are registered in Exams can test anything from the lectures for your section! 7 8 Assignment Lab Accounts All registered students have accounts in the assignment lab ID is same as your Unix ID, and password is initially the first seven digits of your student number If you registered late, go to AQ3143 with your name,unix ID, and student number Grant Dimock or Don Seeley will give you an account Borland C++ (BC++) Use version 5 or higher You can use a different C++ compiler at your own risk! Again: download and read Russ Tront s guide to BC++ BC++ is an integrated development environment (IDE) 9 10 Course Textbook Buy this: we'll be following it roughly one chapter per week It comes with special C++ code that we'll be using Appendix A1: coding style guidelines Appendix A2: C++ summary Other Books The other books on the course outline may be useful to you I recommend that you use at least two books, e.g.: The course textbook A C++ reference book (e.g. the Deitel and Deitel book is a good one) 11 12
3 This is probably the best general C++ reference Written by C++'s creator Warning: not for beginners; I don't recommend this if you haven't programmed before! 13 Bjarne Stroustrup C++ s Designer a programming language is really only a very tiny part of the world, and as such, it ought not to be taken too seriously. Keep a sense of proportion - and most importantly - keep a sense of humor. Among major programming languages, C++ is the richest source of puns and jokes. This is no accident. 14 Deitel and Deitel Useful as a C++ reference Has lots of examples showing how to use features of C++ A lot of point-bypoint summaries Not actual size Some students like this book It has exercises with answers Simple, English explanations Warning: leaves out a few aspects of modern C Every Journey Begins with a Single Step In computer science (CS), the first step is to learn the basics of programming a computer CS is the study of programmable machines Even if you leave CS, programming is a useful (and lucrative!) skill The C++ Programming Language In this course, all the programming will be done in C++ C++ is currently the premier generalpurpose programming language Much (most?) store-bought PC software is written in C++ C++ is big, messy, and complex 17 18
4 Why C++? C++ is Practical Powerful Popular We won't (can't!) go into all the details of C++ Only the most fundamental parts Later courses will cover more advanced features 19 C++ Facts Designed by Bjarne Stroustrup starting in the early 1980s Originally called C with classes Based on C, a lower-level language developed in the 1970s C++ is, practically, a superset of C C++ improves upon many features of C C programmers take note: you will need to unlearn many C programming habits! 20 C++ is General Purpose C++ is practical for many different kind of applications, e.g. operating systems, compilers, databases, graphics, etc. We won't use all of C++'s features; some are Advanced, e.g. templates and inheritance Ensure backwards compatibility with C, e.g. malloc Application specific, e.g. valarray is for numeric processing 21 Learning C++ C++ is a complex, real-world language Need to master many technical details Getting your first program running can be a challenge! Need to know how to use your computer, e.g. creating, copying, deleting files Borland C++ runs under DOS and Windows (95/98/NT) 22 Three Keys to Programming Practice, practice, practice! Write and understand as many (small) programs as you can Re-read the previous point Even experienced programmers need to keep in practice Other things help: experience, knowledge, dedication, imagination, organizational skills, common sense, A First C++ Program The traditional first program to write is one that prints the words Hello, world!on the screen C++ provides a standard way to read and write characters to and from the screen problem solving ability, etc
5 The User (a human) Some Important Objects Screen cout Keyboard cin C++ program The screen and keyboard are the two most common I/O devices, and for this course they will be the main way that a program interacts with the outside world. 25 C++ Input/Output Names The standard output object is named cout Means "console output" The standard input object is named cin Means "console input" cin and cout are for character-based I/O (can t do graphics with them) 26 Hello World! // hello1.cpp // Prints "Hello, world! " on // one line on the screen #include <iostream.h> int main() { cout << "Hello, world!\n"; } 27 Hello Bonnie! // hello2.cpp #include <iostream.h> #include <string> int main() { string name("bonnie"); cout << "Hello, " << name << \n ; } 28 Hello Somebody! // hello3.cpp #include <iostream.h> #include <string> int main() { string name; cout << "What is your name?\n"; cin >> name; cout << "Hello, " << name << \n ; } 29 Hello Bonnie and Clyde! // hello4.cpp #include <iostream.h> #include <string> int main() { string first_name; string second_name; cout << "Enter 2 names (separated by a space): "; cin >> first_name; cin >> second_name; cout << "Hello, " << first_name << " and " << second_name << \n ; } 30
6 One Plus One // oneplusone.cpp #include <iostream.h> int main() { cout << "1 plus 1 is " << (1+1) << \n ; } 31 X plus Y // xplusy.cpp #include <iostream.h> int main() { cout << "Please enter an int: "; int x; // declares the variable x; has a junk value cin >> x; cout << "Please enter another int: "; int y; cin >> y; cout << x << " plus " << y << " is " << (x+y) << \n ; } 32 Programs and Algorithms A program implements an algorithm Programs are sometimes referred to as implementations A program must be written in a particular programming language (like C++) CMPT-101 teaches basic methods for implementing algorithms 33 Algorithms An algorithm is a description of a step by step process Every step must be precisely understood An algorithm takes input and produces output An algorithm is an abstract idea, and the same algorithm can have many different implementations 34 How do You do Laundry? Making Change Write an algorithm for doing the laundry Take out your pocket change, and make two piles of equal value; try it now! 35 36
7 When is Easter? The Gregorian Calendar At the first council of Nicaea (A.D. 325) it was decided that Easter would be the first Sunday after the first full moon after the vernal equinox Different calendars calculate Easter (and other dates) in different ways We'll stick to the traditional Western calendar 37 In 1582, Pope Gregory XIII introduced the calendar we still use today The previous calendar is the Julian calendar A main reason for this new calendar was to make Easter occur in spring! A Julian year is slightly longer than an actual year 38 When is Easter? Calculating what day of the year Easter occurs on is surprisingly difficult We'll look at an algorithm for determining Easter, given a particular year We won't worry about how this algorithm was discovered, just how it can be implemented in C++ 39 Easter Dates, 1900 to 1943 Year Date Year Date Year Date / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /25 40 Easter Dates, 1944 to 1988 Easter Dates, 1989 to 2033 Year Date Year Date Year Date / / /21 Year Date Year Date Year Date / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /17 42
8 Easter Dates, 2034 to 2078 Easter Dates, 2079 to 2099 Year Date Year Date Year Date / / / / / / / / / / / / / / / / / / / / /29 Year Date Year Date Year Date / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / An Easter Algorithm What day will Easter fall on in the year 2085? Answer: March 22 Here is an algorithm that will give the date of Easter for any year from 1900 to An Easter Algorithm Step 1: Call the year Y. Subtract 1900 from Y and call the difference N. Step 2: Divide N by 19. Call the remainder A. Step 3: Divide (7A+1) by 19. Ignore the remainder and call the quotient B. Step 4: Divide (11A+4-B) by 29. Call the remainder M. Step 5: Divide N by 4. Ignore the remainder and call the quotient Q. Step 6: Divide (N+Q+31-M) by 7. Call the remainder W. Step 7: The date of Easter is 25-M-W. If the result is positive, the month is April. If it is negative, the month is March. 0 means March 31, -1 means March 30, -2 as March 29 and so on to -9 for March Algorithm Execution You can "run" this algorithm by hand You can write the intermediate values on a piece of paper, or just remember them The inventor of this algorithm claims he used it as a party trick! Usually a good idea to try an algorithm by hand Easter 1999 is April 4th Y = 1999 N = Y = = 99 A = N mod 19 = 99 mod 19 = 4 B = (7A + 1) div 19 = 29 div 19 = 1 M = (11A B) mod 29 = 47 mod 29 = 18 Q = N div 4 = 99 div 4 = 24 W = (N + Q M) mod 7 = 136 mod 7 = 3 E = 25 - M - W = = 4 48
9 Easter 2000 is April 23rd Y = 2000 N = Y = = 100 A = N mod 19 = 100 mod 19 = 5 B = (7A + 1) div 19 = 36 div 19 = 1 M = (11A B) mod 29 = 58 mod 29 = 0 Q = N div 4 = 100 div 4 = 25 W = (N + Q M) mod 7 = 156 mod 7 = 2 E = 25 - M - W = = 23 Writing a Program Our goal is to convert the Easter algorithm into a C++ program We will do this in multiple steps, each more refined than the next First, let's imagine how we would like our program to look on the computer's screen Sample Easter Program Screen Please enter a year from 1900 to 2099 (inclusive), and I will tell you the date for Easter: 1999 In 1999, Easter Sunday is April 4th. Discussion For now, assume that the user enters a legal integer But nothing stops them from entering a string like "nineteen ninety nine" If a year outside the range is entered, an error message should be printed Note that the Easter algorithm says nothing about invalid input, but our program must Designing a Solution Flowcharts Before programming the algorithm in C++, it's always a good idea to design the program in a language other than C++ We will mainly use pseudocode, which is an English-like way of describing algorithms There are other methods, for instance... A pictorial way to represent algorithms Run Easter algorithm on Year Print Easter date on screen Yes Get Year from user Is Year from ? No Print error mesage on screen 53 54
10 Flowcharts A diamond represents a decision Each box can represent multiple statements Flowcharts are impractical for anything but small programs Other pictorial design methods exist, especially in object-oriented design Pseudocode Pseudocode is a structured English description of an algorithm This is starting to look like C++ code, but we don't (yet) worry about all the details of C++ Good pseudocode clearly details the important parts of a program Easter Program Pseudocode Get Year from user If Year not in the range then Print an error message Else Run the Easter algorithm on Year Print the date of Easter to the screen End if Pseudocode Notes The indentation is important; it shows independent blocks of code The "if-structure" consists of two code blocks, only one of which is executed The "End if" tag marks the end of the "else" part of the if-structure Pseudocode is very important --- get into the habit of using it! Pseudocode to C++ Getting the Year Our goal is to translate the Easter pseudocode into C++ code We will not do this all at once, but instead we'll do it step by step This is called top-down stepwiserefinement We will use this method again and again throughout the course 59 We will ask the user to enter a year We will store this as an int in the variable Year int Year; cout << "Please enter a year from " << "1900 to 2099 (inclusive): "; cin >> Year; 60
11 Notes on ints The line int Year; declares Year to be a variable of type int It's initial value is unknown --- it could be any int value at all In BC++, ints are 32 bits long Other versions of C++ may differ 61 An int in Memory Year Year refers to a memory location that is interpreted as an integer. The exact encoding may differ depending on your C++ compiler, but positive ints are usually just binary numbers. Negative ints are usually represented in a special complement form. C++ programmers usually need not worry about these details. 62 Checking for a Valid Year We want to print an error message if Year is out of range In other words, we check if this is true: (Year < 1900) or (Year > 2099) If it is, we print an error message; otherwise, we run the Easter algorithm The if-statement The if-statement lets us make decisions if ((Year < 1900) or (Year > 2099)) { cout << "Oops! You entered an invalid year!\n"; } else { // Easter algorithm goes here } // if Notes on the if-statement This is an if-else statement The logical expression (Year < 1900) or (Year > 2099) is called the condition of the if-statement In BC++, or is not recognized as a keyword, although it is legal C++ You can use instead of or, && instead of and,! instead of not 65 Code Blocks A block of code begins with a { and ends with a } This is how C++ groups multiple statements together Every new code block should be indented See style guide in Appendix A1, and on web page (in slightly modified form) 66
12 What We Have So Far int Year; cout << "Please enter a year from " << "1900 to 2099 (inclusive): "; cin >> Year; if ((Year < 1900) or (Year > 2099)) { cout << "Oops! You entered an invalid year!\n"; } else { // Easter algorithm goes here } // if What Next? We need to put the Easter algorithm in the else part of the if-statement This still requires some work The finished code goes inside main, and includes any necessary files (we need at least iostream) This is easier, so let's do it first C++ Program Template #include <iostream.h> int main() { // code goes here } // main Notes Any program that uses cin or cout must include <iostream> or <iostream.h>, depending on your C++ compiler main is a special function that returns an int In some books you might see void main, but that's technically wrong (although some C++ compilers accept it!) C++ Style The programs presented in lecture are often simplified so they fit onto slides For your own programs, follow the textbook style The web page contains a slightly modified version of the coding guidelines given in appendix A1 of the textbook The Easter Algorithm Now let's write the basic Easter algorithm in C++ In C++ The mod operator is % e.g. (22 % 7) is 1, (22 % 5) is 2, (22 % 8) is 6,... The div operator is / e.g. (22 / 7) is 3, (22 / 5) is 4, (22 / 8) is 2,
13 The Easter Algorithm in C++ So When is Easter? int N = Year ; int A = N % 19; int B = (7*A + 1) / 19; int M = (11*A B) % 19; int Q = N / 4; int W = (N + Q M) % 7; int Easter = 25 - M - W; 73 To figure out the day of Easter, we must follow these rules: If Easter <= 0, then it's on March (Easter+31) If Easter > 0, then it's on April (Easter) We use another if-statement here Easter Algorithm if (Easter <= 0) { cout << "In " << Year << ", " << "Easter occurs on March " << (Easter + 31) << \n ; } else { cout << "In " << Year << ", " << "Easter occurs on April " << Easter << \n ; } // if 75 A Complete Program That's it --- if you put all the pieces together in the right order, you have a C++ program that calculates Easter for any year from 1900 to 2099 Now you should test the program and ensure that its output matches the correct dates (as given on the earlier Easter date lists) 76 Testing a Program Testing Testing a program is simple but timeconsuming: give it some input and check that it produces the correct output This means you need to know the correct output ahead of time You must work out the correct output by hand, or somehow know it in advance When testing, try values that are Extreme, i.e. at the ends of the legal input ranges Ordinary Invalid Be a gorilla when you test programs: try hard to break them! 77 78
14 When it Works When it s All Done When you've done a good job of testing your program, and it works properly, then you might want to spruce it up For instance, you could make it more user-friendly by adding more on-screen instructions, or making the formatting neater, etc. But don't do this until your program works! 79 TAKE A BREAK!!! 80
3. Simple Types, Variables, and Constants
3. Simple Types, Variables, and Constants This section of the lectures will look at simple containers in which you can storing single values in the programming language C++. You might find it interesting
More informationCOMP322 - Introduction to C++ Lecture 01 - Introduction
COMP322 - Introduction to C++ Lecture 01 - Introduction Robert D. Vincent School of Computer Science 6 January 2010 What this course is Crash course in C++ Only 14 lectures Single-credit course What this
More information(0) introduction to the course. how to learn a programming language. (0) course structure
topics: (0) introduction to the course (1) what is a computer? instructor: cis1.5 introduction to computing using c++ (robotics applications) spring 2008 lecture # I.1 introduction Prof Azhar, mqazhar@sci.brooklyn.cuny.edu
More information5. Control Statements
5. Control Statements This section of the course will introduce you to the major control statements in C++. These control statements are used to specify the branching in an algorithm/recipe. Control statements
More informationCE221 Programming in C++ Part 1 Introduction
CE221 Programming in C++ Part 1 Introduction 06/10/2017 CE221 Part 1 1 Module Schedule There are two lectures (Monday 13.00-13.50 and Tuesday 11.00-11.50) each week in the autumn term, and a 2-hour lab
More informationCS 106B, Lecture 1 Introduction to C++
CS 106B, Lecture 1 Introduction to C++ reading: Programming Abstractions in C++, Chapters 1 & 2 This document is copyright (C) Stanford Computer Science and Ashley Marty Stepp, Taylor, licensed under Creative
More informationWhat is Iteration? CMPT-101. Recursion. Understanding Recursion. The Function Header and Documentation. Recursively Adding Numbers
What is Iteration? CMPT-101 Week 6 Iteration, Iteration, Iteration, Iteration, Iteration, Iteration,... To iterate means to do the same thing again and again and again and again... There are two primary
More informationFundamentals of Structured Programming
Fundamentals of Structured Programming Dr. Salma Hamdy s.hamdy@cis.asu.edu.eg 1 Course Logistics Staff Teachers Prof. Mohamed Roushdy (Dean) Dr. Salma Hamdy Contact: s.hamdy@cis.asu.edu.eg Office: FCIS,
More informationMidterms Save the Dates!
University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Primitive Data Types Arithmetic Operators Readings Your textbook is Big Java (3rd Ed). This Week s Reading: Ch 2.1-2.5, Ch 4.1-4.2.
More informationToday. An Animated Introduction to Programming. Prerequisites. Computer programming
Today 1 2 3 4 Computer programming What is this course about? We re making several assumptions about you as a student. In particular, we assume that you have: Never taken a programming course before. Have
More informationIntroduction to Scientific Computing with C++ Introduction Textbook Assignments Lab Accounts and Software HELLO ADD INTS MANDEL Conclusion
Introduction http://people.sc.fsu.edu/ jburkardt/isc/week01/ lecture 01.pdf... ISC3313: Introduction to Scientific Computing with C++ Summer Semester 2011... John Burkardt Department of Scientific Computing
More information1) Log on to the computer using your PU net ID and password.
CS 150 Lab Logging on: 1) Log on to the computer using your PU net ID and password. Connecting to Winter: Winter is the computer science server where all your work will be stored. Remember, after you log
More informationMobile App:IT. Methods & Classes
Mobile App:IT Methods & Classes WHAT IS A METHOD? - A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. -
More information2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...
Remembering numbers (and other stuff)... Let s talk about one of the most important things in any programming language. It s called a variable. Don t let the name scare you. What it does is really simple.
More informationExcerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.
Chapter 5 Using the Integers In spite of their being a rather restricted class of numbers, the integers have a lot of interesting properties and uses. Math which involves the properties of integers is
More informationCS 101: Computer Programming and Utilization. Abhiram Ranade
CS 101: Computer Programming and Utilization Abhiram Ranade CS 101: Computer Programming and Utilization Abhiram Ranade Course Overview How to represent problems on a computer and solve them Programming
More informationChapters 1 & 2 Programming and Programs
Chapters 1 & 2 Programming and Programs Instructor: Dr. Hyunyoung Lee Based on slides by Dr. Bjarne Stroustrup www.stroustrup.com/programming Abstract Today, we ll outline the aims for this course and
More informationUnderstanding main() function Input/Output Streams
Understanding main() function Input/Output Streams Structure of a program // my first program in C++ #include int main () { cout
More informationCS31 Discussion 1E. Jie(Jay) Wang Week1 Sept. 30
CS31 Discussion 1E Jie(Jay) Wang Week1 Sept. 30 About me Jie Wang E-mail: holawj@gmail.com Office hour: Wednesday 3:30 5:30 BH2432 Thursday 12:30 1:30 BH2432 Slides of discussion will be uploaded to the
More informationLesson 1. Introduction to Programming OBJECTIVES
Introduction to Programming If you re new to programming, you might be intimidated by code and flowcharts. You might even wonder how you ll ever understand them. This lesson offers some basic ideas and
More informationComputer Science II Lecture 1 Introduction and Background
Computer Science II Lecture 1 Introduction and Background Discussion of Syllabus Instructor, TAs, office hours Course web site, http://www.cs.rpi.edu/courses/fall04/cs2, will be up soon Course emphasis,
More informationWelcome to Solving Problems with Computers I
Welcome to Solving Problems with Computers I CS 16: Solving Problems with Computers I Lecture #1 Ziad Matni Dept. of Computer Science, UCSB Image from agorolabs on slideshare.com A Word About Registration
More informationWelcome to MCS 360. content expectations. using g++ input and output streams the namespace std. Euclid s algorithm the while and do-while statements
Welcome to MCS 360 1 About the Course content expectations 2 our first C++ program using g++ input and output streams the namespace std 3 Greatest Common Divisor Euclid s algorithm the while and do-while
More informationOverview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program
Overview - General Data Types - Categories of Words - The Three S s - Define Before Use - End of Statement - My First Program a description of data, defining a set of valid values and operations List of
More informationCS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 1: Overview http://courses.cs.cornell.edu/cs2110 1 Course Staff Instructor Thorsten Joachims (tj@cs.cornell.edu)
More informationTopic 1: Programming concepts
Topic 1: Programming concepts Learning Outcomes Upon successful completion of this topic you will be able to: identify stages of a program development implement algorithm design techniques break down a
More informationWelcome to... CS113: Introduction to C
Welcome to... CS113: Introduction to C Instructor: Erik Sherwood E-mail: wes28@cs.cornell.edu Course Website: http://www.cs.cornell.edu/courses/cs113/2005fa/ The website is linked to from the courses page
More informationAP Computer Science Summer Work Mrs. Kaelin
AP Computer Science Summer Work 2018-2019 Mrs. Kaelin jkaelin@pasco.k12.fl.us Welcome future 2018 2019 AP Computer Science Students! I am so excited that you have decided to embark on this journey with
More informationIntroduction to C++ Dr M.S. Colclough, research fellows, pgtas
Introduction to C++ Dr M.S. Colclough, research fellows, pgtas 5 weeks, 2 afternoons / week. Primarily a lab project. Approx. first 5 sessions start with lecture, followed by non assessed exercises in
More informationCSCI 111 First Midterm Exam Fall Solutions 09.00am 09.50am, Wednesday, October 18, 2017
QUEENS COLLEGE Department of Computer Science CSCI 111 First Midterm Exam Fall 2017 10.18.17 Solutions 09.00am 09.50am, Wednesday, October 18, 2017 Problem 1 (10 points) The following C++ program has errors
More informationCS120 Computer Science I. Instructor: Jia Song
CS120 Computer Science I Instructor: Jia Song Instructor Contact Information Instructor: Dr. Jia Song Email: jsong@uidaho.edu (Preferred) Phone: (208) 885-1710 Office: JEB 240 (CSDS Security Lab) JEB 340
More informationCS240: Programming in C
CS240: Programming in C Lecture 1: Class overview. Cristina Nita-Rotaru Lecture 1/ Fall 2013 1 WELCOME to CS240 Cristina Nita-Rotaru Lecture 1/ Fall 2013 2 240 Team Instructor: Cristina Nita-Rotaru Special
More information2. You are required to enter a password of up to 100 characters. The characters must be lower ASCII, printing characters.
BLACK BOX SOFTWARE TESTING SPRING 2005 DOMAIN TESTING LAB PROJECT -- GRADING NOTES For all of the cases below, do the traditional equivalence class and boundary analysis. Draw one table and use a new line
More informationTips from the experts: How to waste a lot of time on this assignment
Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be
More informationMore Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6
More Examples Using Functions and Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #6 Ziad Matni Dept. of Computer Science, UCSB Administrative CHANGED T.A. OFFICE/OPEN LAB
More informationA PROGRAM IS A SEQUENCE of instructions that a computer can execute to
A PROGRAM IS A SEQUENCE of instructions that a computer can execute to perform some task. A simple enough idea, but for the computer to make any use of the instructions, they must be written in a form
More informationChapter 5 Errors. Bjarne Stroustrup
Chapter 5 Errors Bjarne Stroustrup www.stroustrup.com/programming Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must deal with incomplete problem specifications,
More informationOutline. Computer Science 331. Course Information. Assessment. Contact Information Assessment. Introduction to CPSC 331
Outline Computer Science 331 Introduction to CPSC 331 Mike Jacobson Department of Computer Science University of Calgary Lecture #1 1 Contact Information 2 3 Expected Background 4 How to Succeed 5 References
More informationHow to approach a computational problem
How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to
More informationWelcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 1/9/ Review. Here s a simple C++ program:
Welcome Back CSCI 262 Data Structures 2 - Review What you learned in CSCI 261 (or equivalent): Variables Types Arrays Expressions Conditionals Branches & Loops Functions Recursion Classes & Objects Streams
More informationInteger Multiplication and Division
Integer Multiplication and Division for ENCM 369: Computer Organization Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 208 Integer
More informationCSC 111 Introduction to Computer Science (Section C)
CSC 111 Introduction to Computer Science (Section C) Course Description: (4h) Lecture and laboratory. Rigorous introduction to the process of algorithmic problem solving and programming in a modern programming
More informationChapter 5 Errors. Hyunyoung Lee. Based on slides by Bjarne Stroustrup.
Chapter 5 Errors Hyunyoung Lee Based on slides by Bjarne Stroustrup www.stroustrup.com/programming 1 Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must
More informationProblem Solving With C++ Ninth Edition
CISC 1600/1610 Computer Science I Programming in C++ Professor Daniel Leeds dleeds@fordham.edu JMH 328A Introduction to programming with C++ Learn Fundamental programming concepts Key techniques Basic
More informationCONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction
CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want
More informationSkill 1: Multiplying Polynomials
CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need
More informationCSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch
CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed
More information************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE
Program 10: 40 points: Due Tuesday, May 12, 2015 : 11:59 p.m. ************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE *************
More informationEP241 Computer Programming
EP241 Computer Programming Topic 1 Dr. Ahmet BİNGÜL Department of Engineering Physics University of Gaziantep Modifications by Dr. Andrew BEDDALL Department of Electric and Electronics Engineering Sep
More informationKing Abdulaziz University Faculty of Computing and Information Technology Computer Science Department
King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department CPCS202, 1 st Term 2016 (Fall 2015) Program 5: FCIT Grade Management System Assigned: Thursday, December
More informationCSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education
CSE 142 Lecture 1 Course Introduction; Basic Java Welcome Today: Course mechanics A little about computer science & engineering (CSE) And how this course relates Java programs that print text 2 Handouts
More information5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.
Today! Build HelloWorld yourself in BlueJ and Eclipse. Look at all the Java keywords. Primitive Types. HelloWorld in BlueJ 1. Find BlueJ in the start menu, but start the Select VM program instead (you
More informationSlide 1 CS 170 Java Programming 1 Expressions Duration: 00:00:41 Advance mode: Auto
CS 170 Java Programming 1 Expressions Slide 1 CS 170 Java Programming 1 Expressions Duration: 00:00:41 What is an expression? Expression Vocabulary Any combination of operators and operands which, when
More informationAbstract. Chapter 6 Writing a Program. Overview. Writing a program: Strategy. Building a program. Bjarne Stroustrup
Abstract Chapter 6 Writing a Program This lecture and the next describe the process of designing a program through the example of a simple desk calculator. Bjarne Stroustrup www.stroustrup.com/programming
More informationENCM 369 Winter 2019 Lab 6 for the Week of February 25
page of ENCM 369 Winter 29 Lab 6 for the Week of February 25 Steve Norman Department of Electrical & Computer Engineering University of Calgary February 29 Lab instructions and other documents for ENCM
More informationOutline. CIS 110: Introduction to Computer Programming. What is Computer Science? What is computer programming? What is computer science?
Outline CIS 110: Introduction to Computer Programming Lecture 1 An introduction of an introduction ( 1.1 1.3)* 1. What is computer science and computer programming? 2. Introductions and logistics 3. The
More informationComputer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation
Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Yan Shi SE 2730 Lecture Notes Verification and Validation Verification: Are
More informationProblem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 04 Introduction to Programming Language Concepts
More informationChapter 4. Computation. Bjarne Stroustrup.
Chapter 4 Computation Bjarne Stroustrup www.stroustrup.com/programming Abstract Today, I ll present the basics of computation. In particular, we ll discuss expressions, how to iterate over a series of
More informationWeek 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966?
Week 5: Background A few observations on learning new programming languages What's wrong with this (actual) protest from 1966? Programmer: "Switching to PL/I as our organization's standard programming
More informationCSI33 Data Structures
Outline Department of Mathematics and Computer Science Bronx Community College October 22, 2018 Outline Outline 1 Chapter 8: A C++ Introduction For Python Programmers ords Data Types And Variable Declarations
More informationCS 142 Style Guide Grading and Details
CS 142 Style Guide Grading and Details In the English language, there are many different ways to convey a message or idea: some ways are acceptable, whereas others are not. Similarly, there are acceptable
More informationIntro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?
Intro to Programming & C++ Unit 1 Sections 1.1-4 and 2.1-10, 2.12-13, 2.15-17 CS 1428 Spring 2019 Jill Seaman 1.1 Why Program? Computer programmable machine designed to follow instructions Program a set
More informationCompilers for Modern Architectures Course Syllabus, Spring 2015
Compilers for Modern Architectures Course Syllabus, Spring 2015 Instructor: Dr. Rafael Ubal Email: ubal@ece.neu.edu Office: 140 The Fenway, 3rd floor (see detailed directions below) Phone: 617-373-3895
More informationCMSC Introduction to Database Systems
CMSC 23500 Introduction to Database Systems Department of Computer Science University of Chicago Spring 2009 Quarter Dates: March 30 through June 2, 2009 Lectures: TuTh 12:00-1:20 in Ryerson 277 Labs:
More informationChapter 2 C++ Fundamentals
Chapter 2 C++ Fundamentals 3rd Edition Computing Fundamentals with C++ Rick Mercer Franklin, Beedle & Associates Goals Reuse existing code in your programs with #include Obtain input data from the user
More informationTips from the experts: How to waste a lot of time on this assignment
Com S 227 Spring 2017 Assignment 1 80 points Due Date: Thursday, February 2, 11:59 pm (midnight) Late deadline (25% penalty): Friday, February 3, 11:59 pm General information This assignment is to be done
More informationWELCOME TO CS 16! Enrollment status: 117/ Problem Solving with Computers-I
WELCOME TO CS 16! Problem Solving with Computers-I https://ucsb-cs16-s18-mirza.github.io/ Enrollment status: 117/105 2 About me Diba Mirza (diba@ucsb.edu) PhD (Computer Engineering, UCSD) First year as
More informationWelcome Back. CSCI 262 Data Structures. Hello, Let s Review. Hello, Let s Review. How to Review 8/19/ Review. Here s a simple C++ program:
Welcome Back CSCI 262 Data Structures 2 - Review What you learned in CSCI 261 (or equivalent): Variables Types Arrays Expressions Conditionals Branches & Loops Functions Recursion Classes & Objects Streams
More informationCS 126 Lecture P1: Introduction to C
CS 126 Lecture P1: Introduction to C Administrivia Background Syntax Libraries Algorithms Outline CS126 2-1 Randy Wang To Get Started Visit course web page: - http://www.cs.princeton.edu/courses/cs126
More informationCS Exam 2 Study Suggestions
CS 131 - Fall 2009 p. 1 last modified: 11-10-09 CS 131 - * Remember: anything covered in lecture, in lab, or on a homework, is FAIR GAME. * You are responsible for all of the material covered through Week
More informationIS 0020 Program Design and Software Tools
1 IS 0020 Program Design and Software Tools Introduction to C++ Programming Spring 2005 Lecture 1 Jan 6, 2005 Course Information 2 Lecture: James B D Joshi Tuesdays/Thursdays: 1:00-2:15 PM Office Hours:
More informationBeijing Jiaotong University CS-23: C++ Programming Summer, 2019 Course Syllabus
Beijing Jiaotong University CS-23: C++ Programming Summer, 2019 Course Syllabus Course Personnel: Instructor Name: Jovan Ilić Office: TBD Phone: TBD e-mail: TBD Teaching Assistants Name: TBD Office: TBD
More informationSlide 1 CS 170 Java Programming 1
CS 170 Java Programming 1 Objects and Methods Performing Actions and Using Object Methods Slide 1 CS 170 Java Programming 1 Objects and Methods Duration: 00:01:14 Hi Folks. This is the CS 170, Java Programming
More informationCSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York
CSc 10200! Introduction to Computing Lecture 1 Edgardo Molina Fall 2013 City College of New York 1 Introduction to Computing Lectures: Tuesday and Thursday s (2-2:50 pm) Location: NAC 1/202 Recitation:
More informationChapter 2. Editing And Compiling
Chapter 2. Editing And Compiling Now that the main concepts of programming have been explained, it's time to actually do some programming. In order for you to "edit" and "compile" a program, you'll need
More informationThese are notes for the third lecture; if statements and loops.
These are notes for the third lecture; if statements and loops. 1 Yeah, this is going to be the second slide in a lot of lectures. 2 - Dominant language for desktop application development - Most modern
More information1 of 8 3/28/2010 8:03 AM C++ Special Topics Home Class Info Links Lectures Newsgroup Assignmen This is a short review of special topics in C++ especially helpful for various assignments. These notes are
More informationNote: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.
Com S 227 Fall 2017 Miniassignment 1 50 points Due Date: Monday, October 16, 11:59 pm (midnight) Late deadline (25% penalty): Tuesday, October 17, 11:59 pm General information This assignment is to be
More informationChapter 6 Writing a Program
Chapter 6 Writing a Program Hartmut Kaiser hkaiser@cct.lsu.edu http://www.cct.lsu.edu/~hkaiser/fall_2010/csc1253.html Slides adapted from: Bjarne Stroustrup, Programming Principles and Practice using C++
More informationCHAPTER 2.1 CONTROL STRUCTURES (SELECTION) Dr. Shady Yehia Elmashad
CHAPTER 2.1 CONTROL STRUCTURES (SELECTION) Dr. Shady Yehia Elmashad Outline 1. The if Selection Structure 2. The if/else Selection Structure 3. The switch Multiple-Selection Structure 1. The if Selection
More informationCSCI 136 Data Structures & Advanced Programming. Spring 2018 Instructors Bill Jannen & Jon Park
CSCI 136 Data Structures & Advanced Programming Spring 2018 Instructors Bill Jannen & Jon Park Today s Outline Course Preview Course Bureaucracy Crash Course in Java Part 1 2 Why Take CS136? To learn about:
More informationDr. Md. Humayun Kabir CSE Department, BUET
C++ Dr. Md. Humayun Kabir CSE Department, BUET History of C++ Invented by Bjarne Stroustrup at Bell Lab in 1979 Initially known as C with Classes Classes and Basic Inheritance The name was changed to C++
More informationConstructing Algorithms and Pseudocoding This document was originally developed by Professor John P. Russo
Constructing Algorithms and Pseudocoding This document was originally developed by Professor John P. Russo Purpose: # Describe the method for constructing algorithms. # Describe an informal language for
More informationCompiling with Multiple Files The Importance of Debugging CS 16: Solving Problems with Computers I Lecture #7
Compiling with Multiple Files The Importance of Debugging CS 16: Solving Problems with Computers I Lecture #7 Ziad Matni Dept. of Computer Science, UCSB Programming in Multiple Files The Magic of Makefiles!
More informationA function is a named piece of code that performs a specific task. Sometimes functions are called methods, procedures, or subroutines (like in LC-3).
CIT Intro to Computer Systems Lecture # (//) Functions As you probably know from your other programming courses, a key part of any modern programming language is the ability to create separate functions
More informationENCM 335 Fall 2018 Lab 2 for the Week of September 24
page 1 of 8 ENCM 335 Fall 2018 Lab 2 for the Week of September 24 Steve Norman Department of Electrical & Computer Engineering University of Calgary September 2018 Lab instructions and other documents
More informationIntroduction to the course and basic programming concepts
Introduction to the course and basic programming concepts Lecture 1 of TDA 540 Object-Oriented Programming Jesper Cockx Fall 2018 Chalmers University of Technology Gothenburg University About the course
More informationCIS*1500 Introduction to Programming
CIS*1500 Introduction to Programming CIS*1500 Learning to program The basic constructs of programming Programming in the C language Solving real problems Not just about coding! About me??? Some basic things...
More informationProgramming - 1. Computer Science Department 011COMP-3 لغة البرمجة 1 لطالب كلية الحاسب اآللي ونظم المعلومات 011 عال- 3
Programming - 1 Computer Science Department 011COMP-3 لغة البرمجة 1 011 عال- 3 لطالب كلية الحاسب اآللي ونظم المعلومات 1 1.1 Machine Language A computer programming language which has binary instructions
More informationo Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement
Last Time Let s all Repeat Together 10/3/05 CS150 Introduction to Computer Science 1 1 We covered o Counter and sentinel controlled loops o Formatting output Today we will o Type casting o Top-down, stepwise
More informationC++ Programming for Non-C Programmers. Supplement
C++ Programming for Non-C Programmers Supplement ii C++ Programming for Non-C Programmers C++ Programming for Non-C Programmers Published by itcourseware, 10333 E. Dry Creek Rd., Suite 150, Englewood,
More informationWELCOME TO CS 16! Problem Solving with Computers-I
WELCOME TO CS 16! Problem Solving with Computers-I 2 Instructor/TAs Lawton Nichols I m just a PhD Student, so you don t have to call me professor Office hours: Tuesday, Thursday: 3:30pm 4:30pm in the TA
More informationCS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG
CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday
More informationCS 132 Exam #1 - Study Suggestions
CS 132 - Exam #1 Study Suggestions p. 1 * last modified: 2-16-05 CS 132 Exam #1 - Study Suggestions * The test covers through HW #3, the Week 5 Lab Exercise Exercise, and material through the 2-14-05 lecture/2-16-05
More informationHi everyone. Starting this week I'm going to make a couple tweaks to how section is run. The first thing is that I'm going to go over all the slides
Hi everyone. Starting this week I'm going to make a couple tweaks to how section is run. The first thing is that I'm going to go over all the slides for both problems first, and let you guys code them
More informationMidterms Save the Dates!
University of British Columbia CPSC 111, Intro to Computation Alan J. Hu (Using the Scanner and String Classes) Anatomy of a Java Program Readings This Week s Reading: Ch 3.1-3.8 (Major conceptual jump
More informationIntroduction to Programming
Introduction to Programming session 6 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Spring 2011 These slides are created using Deitel s slides Sharif University of Technology Outlines
More informationCSC108: Introduction to Computer Programming. Lecture 1
CSC108: Introduction to Computer Programming Lecture 1 Wael Aboulsaadat Acknowledgment: these slides are based on material by: Velian Pandeliev, Diane Horton, Michael Samozi, Jennifer Campbell, and Paul
More informationSyllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)
Syllabus COSC-051-x - Computer Science I Fall 2018 Instructor: Jeremy Bolton, Ph.D. Asst Teaching Professor Department of Computer Science Office: TBD (see Course calendar for office hours) Email: jeremy.bolton@georgetown.edu
More information