13 Pages

intro

Course: CS 111, Fall 2009
School: BU
Rating:
 
 
 
 
 

Word Count: 1360

Document Preview

to Introduction Computer Science I Course Overview Programming in Java Computer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D. Welcome to CS 111! Computer science is not so much the science of computers as it is the science of solving problems using computers. Eric Roberts This course covers: the process of developing algorithms to solve problems the process of developing computer...

Register Now

Unformatted Document Excerpt

Coursehero >> Massachusetts >> BU >> CS 111

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
to Introduction Computer Science I Course Overview Programming in Java Computer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D. Welcome to CS 111! Computer science is not so much the science of computers as it is the science of solving problems using computers. Eric Roberts This course covers: the process of developing algorithms to solve problems the process of developing computer programs to express those algorithms Computer Science and Programming There are many different fields within CS, including: software systems computer architecture networking programming languages, compilers, etc. theory AI Experts in many of these fields dont do much programming! However, learning to program will help you to develop ways of thinking and solving problems used in all fields of CS. A Rigorous Introduction Intended for: CS, math, and physical science concentrators others who want a rigorous introduction no programming background required, but can also benefit people with prior background Allow for 10-15 hours of work per week start work early! Less rigorous alternatives include: CS 101: overview of CS, a bit of programming CS 105: databases and data mining 1/3 of course is learning to program in Python CS 108: a less rigorous intro. to programming also uses Python CS 111 Requirements Attendance at and participation in lectures and labs (10%) email us ahead of time if you have a conflict labs begin next week held in the CS teaching lab, EMA 304 complete Lab 0 sometime this week (see course website) Ten problem sets (40%) must be your own work: see syllabus for details Three quizzes (25%) no makeups, so please mark your calendars! Final exam (25%) Textbook Building Java Programs by Stuart Reges and Marty Stepp (Addison Wesley, 2008). were using a custom Boston University edition available at Barnes & Noble omits material that we don't cover cheaper! the standard edition is also fine Also required: The CS 111 Coursepack contains all of the lecture notes available at Fedex Kinkos on Cummington Street Course Staff Instructor: Dave Sullivan (dgs@cs.bu.edu) Teaching fellow: Tai-Peng Tian (tian@cs.bu.edu) Office hours and contact info. will be available on the course website: http://www.cs.bu.edu/courses/cs111 For general course-related questions, email: cs111-staff@cs.bu.edu which will forward your question to the full course staff. Other Details of the Syllabus Academic conduct Policies: lateness please don't request an extension unless it's an emergency! grading Please read the syllabus carefully and make sure that you understand the policies and follow them carefully. Let us know if you have any questions. Algorithms In order to solve a problem using a computer, you need to come up with one or more algorithms. An algorithm is a step-by-step description of how to accomplish a task. An algorithm must be: precise: specified in a clear and unambiguous way effective: capable of being carried out Example of Defining an Algorithm Algorithm for Finding My Office 1. Go to the entrance to the MCS (math/CS) building at 111 Cummington Street behind Warren Towers. (It is the pink part of the building.) 2. Cross the street to the pair of doors across from MCS. 3. Enter those doors and take an immediate right. Algorithm for Finding My Office (cont.) 4. Open the door to the stairway and go up to the second floor. 5. Upon exiting the stairs, turn right. 6. Take an immediate left into a small hallway. 7. My office is the first door on the left (PSY 228D). Programming Programming involves expressing an algorithm in a form that a computer can interpret. We will be using the Java programming language. one of many possible languages The key concepts of the course transcend this language. Programs and Classes In Java, all programs consist of one of more classes. For now: we'll limit ourselves to writing a single class you can just think of a class as a container for your program Example: a program that displays a simple message: public class HelloWorld { public static void main(String[] args) { System.out.println("hello, world"); } } A class must be defined in a file with a name of the form <classname>.java for the class above, the name would be HelloWorld.java Using an IDE An integrated development environment (IDE) is an application helps that you develop programs. Well use the Dr. Java IDE. Lab 0 tells you how to obtain and install it. Please do so ASAP. With an IDE, you do the following: use its built-in text editor to write your code instruct the IDE to compile the code instruct the IDE to run the program debug as needed, using the IDE's debugging tools Using Dr. Java Format of a Java Class General syntax: public class <name> { code goes here } where <name> is replaced by the name of the class. Notes: the class begins with a header: public class <name> the code inside the class is enclosed in curly braces ({ and }) Methods A method is a collection of instructions that perform some action or computation. Every Java program must include a method called main. contains the instructions that will be executed first when the program is run Our example program includes a main method with a single instruction: public class HelloWorld { public static void main(String[] args) { System.out.println("hello, world"); } } Methods (cont.) General syntax for the main method: public static void main(String[] args) { <statement>; <statement>; <statement>; } where each <statement> is replaced by a single instruction. Notes: the main method always begins with the same header: public static void main(String[] args) the code inside the method is enclosed in curly braces each statement typically ends with a semi-colon the statements are carried out (executed) sequentially, one after the other Identifiers Used to name the components of a Java program like classes and methods. Rules: must begin with a letter (a-z, A-Z), $, or _ can be followed by any number of letters, numbers, $, or _ spaces are not allowed cannot be the same as a keyword a word like class that is part of the language itself (see the book) Which of these are not valid identifiers? n1 avgSalary num_values course name 2n Java is case-sensitive (for both identifiers and keywords). example: HelloWorld is not the same as helloWorld Conventions for Identifiers Capitalize class names. example: HelloWorld Do not capitalize method names. example: main Capitalize internal words within the name. example: HelloWorld Printing Text public class HelloWorld { public static void main(String[] args) { System.out.println("hello, world"); } } Our program contains a single statement that prints some text. The printed text appears in a window known as the console. Printing Text (cont.) The general format of such statements is: System.out.println("<text>"); where &l...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

BU - CS - 105
How to Create Unix CS Account(from a Linux workstation)0. Linux workstations can be found on the le hand side (facing Comm. Ave.) of the Undergraduate Computing Lab. When you find an open terminal you will see a login screen similar to Image 1.I
BU - CS - 111
How to Create Unix CS Account(from a Linux workstation)0. Linux workstations can be found on the le hand side (facing Comm. Ave.) of the Undergraduate Computing Lab. When you find an open terminal you will see a login screen similar to Image 1.I
BU - CS - 105
Computer Science 105: Practice Problems on ER Diagrams1.Given the portion of an ER diagram shown above, which of the following statements are true? I. R connects each entity in A to at least one entity in B II. R connects each entity in A to at m
BU - CS - 105
CS105IntroductiontoDatabases andDataAnalysisAMath/CSDivisionalStudiesCourse OfferedinFall2007Databases and other collections of data are everywhere: Retailers use data about customers and their purchases to make decisions that increase profits.
BU - CS - 111
Methods with Parameters and Return ValuesComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Review: Static Methods We've seen how we can use static methods to: 1. capture the structure of a program breaking a task into s
BU - CS - 105
SkyServer: An Astronomical DatabaseComputer Science 105 Boston University Fall 2008 David G. Sullivan, Ph.D.Sloan Digital Sky Survey (SDSS) A database of astronomical data (10s of terabytes) five-year survey mapping 1/4 of the night sky inform
BU - CS - 111
File ProcessingComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Review: Scanner Objects We've been using Scanner objects to read from the console:Scanner console = new Scanner(System.in); By passing System.in to the
BU - CS - 111
RecursionComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Review: Method Frames When you make a method call, the Java runtime sets aside a block of memory known as the frame of that method call.main number otherNumber
BU - CS - 105
Data Mining I: IntroductionComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.References for This Part of the Course Roiger &amp; Geatz, Data Mining: A Tutorial-Based Primer (Addison-Wesley, 2003) Witten &amp; Frank, Data Mining
BU - CS - 105
The SQL Query LanguageComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.What is a Query Language? A query language is a language that can be used to access and modify the contents of a database. SQL is the most widely u
BU - CS - 105
Case Study: Predicting Patient OutcomesComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Dataset Description The &quot;spine clinic dataset&quot; from Roiger &amp; Geatz. Data consists of records for 171 patients who had back surgery
BU - CS - 105
Programming in Python IV: Working with StringsComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Strings in Python The string data type is used to represent text data. We've already been using string literals, which cons
BU - CS - 105
Data Mining IV: Preparing the DataComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.The Data Mining Process Key steps: assemble the data in the format needed for data mining typically a text file perform the data min
BU - CS - 105
Programming in Python III: Making DecisionsComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Flow of Control Flow of control = order in which instructions are executed By default, instructions are executed in sequential
BU - CS - 105
SQLiteComputer Science 105 Boston University Fall 2008 David G. Sullivan, Ph.D.What is SQLite? An open-source relational DBMS (RDBMS) we're using version 3 It can be easily downloaded and used on any common type of platform (Windows, Mac, Linu
BU - CS - 105
Programming in Python VI: Working with FilesComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Escape Sequences Recall: we can surround strings by either single or double quotes. doing so allows us to embed quotes within
BU - CS - 105
Computer Science 105 Overview of the Final ExamDate, time, and location Saturday, December 20, 12:30-2:30 p.m., GCB 204 (our usual classroom) Topics covered The exam will cover the entire semester. You do not need to know the Weka-specific details f
BU - CS - 105
Data Mining II: Classification LearningComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Weka Data-Mining Software A free, open-source data-mining tool. we'll use the &quot;book version&quot; Weka is available here: http:/www.cs
BU - CS - 105
Programming BasicsComputer Science 105 Boston University Spring 2009 David G. Sullivan, Ph.D.Beyond Relational Databases While relational databases are extremely powerful, they may be inadequate/insufficient for a given problem. Example 1: DNA
BU - CS - 105
1929Wings1391930Broadway Melody, The1101931Cimarron1311932Grand Hotel1121934Cavalcade1101935It Happened One Night1051936Mutiny on the Bounty1321937Great Ziegfeld, The1761938Life of Emile Zola, The1161939You Can't Take It w
BU - CS - 111
ArraysComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Collections of Data Recall our program for averaging quiz grades:public static void main(String[] args) { Scanner console = new Scanner(System.in); int total = 0;
BU - CS - 111
Indefinite Loops and Boolean ExpressionsComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Review: Definite Loops The loops that we've seen thus far have been definite loops. we know exactly how many iterations will be p
BU - CS - 111
Procedural Decomposition(How to Use Methods to Write Better Programs)Computer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.Example Program: Writing Block Letters Here's a program that writes the name &quot;DEE&quot; in block letters:
BU - CS - 111
Conditional ExecutionComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.What is Conditional Execution? There are situations in which we want a set of instructions to be executed some of the time but not all of the time.
BU - CS - 111
Computer Science 111 Overview of the Final ExamDates, times, and locations Section A1: Friday, December 19, 3-5 p.m., CAS 224 (our usual classroom) Section B1: Saturday, December 20, 9-11 a.m., GCB 205 (our usual classroom) Topics covered The exam w
BU - CS - 111
Inheritance and PolymorphismComputer Science 111 Boston University Spring 2009 David G. Sullivan, Ph.D.A Class for Modeling an Automobilepublic class Automobile { private String make; private String model; private int year; private int mileage;
BU - CS - 330
CS330:AlgorithmTeaching Section 003 TF: Tao Wang Sept. 24, 20031Problem 4.1-6 Solve T (n) = 2T ( n) + 12Problem 4.3-1a)T (n) = 4T (n/2) + n b)T (n) = 4T (n/2) + n2 c)T (n) = 4T (n/2) + n33Permute-By-SortingPERMUTE-BY-SORTING(A) 1 n
BU - CS - 330
CS330:AlgorithmTeaching Section 001 TF: Tao Wang Sept. 9, 20031Note(0)Oce hours: PSY 226, Wed. 3-4, Thur 10-12 Email: wtwangcs.bu.edu Oce Phone#:617-358-2355 (1)Please enroll the mailing-list by $csmail -a cs330 (2)Sometimes, we will discuss t
BU - CS - 411
Chris Stevens, Jeff Lupien, Bill RainfordChapter 3 SummaryChapter 3 introduces the reader to software processes and the considerations that go into choosing the best process for a development project. The author defines a software process as &quot;a se
BU - G - 1200
From - Wed May 24 18:24:15 2000Path: news.bu.edu!logbridge.uoregon.edu!news.worldonline.fr!newsfeed.adm.esc-lille.fr!news.adm.esc-lille.fr!proxad.net!oleane.net!oleane!bignews.mediaways.net!diablo.theplanet.net!europa.netcrusader.net!207.172.3.37!fe
BU - G - 1200
From - Wed Apr 26 13:55:09 2000Path: news.bu.edu!news.eecs.umich.edu!nntp-out.monmouth.com!newspeer.monmouth.com!logbridge.uoregon.edu!leto.backbone.ou.edu!news.ou.edu!not-for-mailX-Newsreader: kexpress 0.8.0MIME-Version: 1.0Content-Type: text/pl
BU - CS - 210
(not X3 and Y3) or (X3 and Y3) or (not X3 and not Y3) and (not X2 and Y2) or (X2 and Y2) or (not X2 and not Y2) and (not X1 and Y1) or (X1 and Y1) or (not X1 and not Y1) and (not X0 and Y0)
BU - CS - 210
(X0 and Y0) or (~X0 and ~Y0) and (X1 and Y1) or (~X1 and ~Y1) and (X2 and Y2) or (~X2 and ~Y2) and (X3 and Y3) or (~X3 and ~Y3) and (X4 and Y4) or (~X4 and ~Y4) and (X5 and Y5) or (~X5 and ~Y5) and (X6 and Y6)
BU - CS - 210
(X0 and Y0) or (~X0 and ~Y0) and (X1 and Y1) or (~X1 and ~Y1) and (X2 and Y2) or (~X2 and ~Y2) and (X3 and Y3) or (~X3 and ~Y3) and (X4 and Y4) or (~X4 and ~Y4) and (X5 and Y5) or (~X5 and ~Y5)
BU - CS - 210
(X0 and Y0) or (~X0 and ~Y0) and (X1 and Y1) or (~X1 and ~Y1) and (X2 and Y2) or (~X2 and ~Y2) and (X3 and Y3) or (~X3 and ~Y3) and (X4 and Y4) or (~X4 and ~Y4) and (X5 and Y5) or (~X5 and ~Y5) and (X6 and Y6)
BU - ED - 101
ED 101 Educational Technology Lab Fall08 BostonUniversitySchoolofEducationYourName Grade/ School Lessontitle Timeof activitiesLindsay Vozar SixthGradeSupervisin gTeacherMr.CohenJacksonMannElementarySchool Asking Questions 30minutes Content
BU - ED - 101
JosephChismar,Mrs.Sanroma,4thgrade,HarringtonElementary ContentArea:Iwillbecoveringastronomy.Morespecifically,Iwilldiscussthe planetsandthestars.Foreachplanet,Iwillgiveitsnameanddescription.For example,IwilltalkaboutMercuryandhowitisthesmallestplanet
BU - ED - 32
JosephChismar,Mrs.Sanroma,4thgrade,HarringtonElementary ContentArea:Iwillbecoveringastronomy.Morespecifically,Iwilldiscussthe planetsandthestars.Foreachplanet,Iwillgiveitsnameanddescription.For example,IwilltalkaboutMercuryandhowitisthesmallestplanet
BU - ED - 101
ED 101 Educational Technology Lab Fall 08 Boston University School of EducationLESSON PLANYour Name Anna Supervising Mrs. Krasco Kyritsis Teacher Grade/School 1st Grade at Harrington Elementary School Lesson title From Caterpillar to Butterfly 1:
BU - ED - 101
ED 101 Educational Technology Lab Fall 08 Boston University School of EducationLESSON PLANYour Name Katie Supervising Miss Birdsall Matthews Teacher Grade/School Alcott School, Grade Four Lesson title Time of activities Rainbows 20 minutes Conten
BU - ED - 101
ED 101 Educational Technology Lab Fall 08 Boston University School of EducationLESSON PLAN (Template)Your Name Supervising Ms. Martin Teacher Grade/School Grade 3/Harrington Lesson title Food Webs: What Eats What? 9am Content area Science Yee Leu
BU - ED - 101
ED 101 Educational Technology Lab Fall 08 Boston University School of EducationLESSON PLANYour Name Supervising Darcy Teacher McSweeney Grade/School Kindergarten/Alcott Elementary School Lesson title Adventures with the Alphabet 15-30 minutes Con
BU - ED - 101
Assessment PlanYour Name Ryan Supervising Ms. Julie Selhub Bergstrom Teacher rd Grade/School 3 Grade/Bowman Elementary Lesson title Time of activities 1st Content Thanksgiving area 30-45 min. computer lecture Events Leading up to Thanksgiving Durati
BU - ED - 101
KINDERGARTEN LESSON PLAN Victoria St. Fleur Kindergarten/Jackson Mann Knock, Knock. Whos there? Social Science and English Language Arts 30 minutes Mrs. GalavinContent Area: Social Science and English Language Arts. A broad perspective on homes for
BU - ED - 101
ED101 Educational Technology Lab Fall 08 Boston University School of EducationYour Name Grade/School Lesson titlePhilippa Supervising Ms. Omobono Moore Teacher nd 2 grade, Harrington Elementary Traditional Native American Culture 2.00pm Content
BU - ED - 101
Melissa Heller Bowman Elementary School 3rd Grade Mrs. Laura Lees Addition, Multiplication, Word Problems, Graphing Math October 2008 Content Area: In my lesson I will cover important mathematics concepts such as addition and multiplication, and I wi
BU - ED - 101
Stephanie Man Alcott Elementary School 4th Grade Geography of the United States November 2008Mrs. LevinSocial Studies1. Content Area: In this Social Studies lesson, I will be covering the physical geography of the United States and the states a
BU - ED - 101
Ketner Alexander Ketner Gardner Pilot Academy 4th Grade Reading Exercises October 2008 Content Area: LITERACY and LANGUAGE I will be covering reading with the students. We will be working on multiple different exercises. These will cover picking out
BU - ED - 101
Briana Goellner Gardner Elementary, 2nd Grade Inference of Character November 2008Ms. GendronLanguage Arts/Literary Understanding Duration: approx. 30 minutesContent Area: Literacy or Language Arts: I will be presenting a mini-lesson about infe
BU - ED - 101
Hannah Rabin ED 101 Educational Technology Lab Fall 08 Boston University School of Education LESSON PLAN and ASSESSMENT PLAN Your Name Grade/School Lesson title Time of activities Hannah Rabin Supervising Teacher 4/5 Combined Special Needs Class The
BU - ED - 101
ED 101 Educational Technology Lab Fall 08 Boston University- School of EducationLESSON PLANName Michelle Supervising Amanda Kosow Teacher Lawrence Grade/School Kindergarten, Harrington Elementary School Lesson title Time of activities Magnets 10:0
BU - ED - 101
Michael Zimmerman 2nd Grade Gardner Pilot Academy Observation Skills November 2008Ms. Stephanie Blake Science 1 hourI. Content - Science I will be covering observation skills and the importance of recording observations. I will explain the need f
BU - ED - 101
ED 101 Lesson Plan Mrs. Wasserman Gardner Pilot Academy/Third Grade Introduction to Geometry Content Area: Math Time of Activity: 30 minutes Duration: Once a weekContent Area: I will be covering basic geometry for the third grade level. I will intr
BU - ED - 010
Harrington Elementary school 4th Grade The Solar System October 10 2008 Content Area: ScienceMiss Towle ScienceTopic: The Solar system: I will give a broad description of the Solar system and then go into more detail concerning the planets, revol
BU - ED - 101
Your Name Grade/School Lesson title Time of activitiesLaurence Supervising Mrs. Class Kozakowski Teacher Harrington School 5th grade Poetry in Content Literacy and Motion area Language T.B.D. Duration of No more than 1 Lesson/Unit hour/T.B.D.Con
BU - ED - 101
Lesson PlanYour NameAlison RussellSupervising Mr. King TeacherGrade/School 7th /Jackson-Mann Elementary SchoolLesson title Time of activitiesWhat makes Content a nation area Early NovemberGeographyDuration of ~45 minutes Lesson/Unit
BU - ED - 101
Kevin Ouellette Bowman Elementary School 3rd Grade The Pilgrims and Plymouth Plantation November 2008Mrs. Bennett HistoryContent Area: The content area of my lesson is Social Studies/History on a third grade level. The lesson will provide informa
BU - ED - 8588
ED 101 Educational Technology Lab Fall 08 Boston University School of EducationLESSON PLAN (Template)Your Name Grade/School Lesson title 5th Grade/ Jackson-Mann Elementary Fifth Grade Content Geometry topics Geometry area Skills 40 min. Duration
BU - ED - 101
Nira Rubin Content Area: Science with Physics and Chemistry as my primary source Topic: Water Subtopics: Goals: Students should understand why water is essential for life to survive and Earth to exist. Students will learn about waters unique pro
BU - ED - 101
Stephanie Hart Ms. Jones -Bowman Elementary School 1st Grade Holidays Around the World October 2008Your NameStephanie Supervising Ms. Jones Hart Teacher Grade/School Bowman Elementary-1st Grade Lesson title Holidays Around the World 30 Minutes Co
BU - ED - 101
Nakita Buckner-Statler Harrington Elementary 5th Grade Order of Operations November 2008 Assessment Plan / Revised Lesson Plan Content Area: MathMs. Khan MathematicsI will be introducing the implementation of order of operations into the fifth gr