Cmpt 128 Assignment Notebook

The unsorted coins are placed in a bin at the top of the Coin Sorter. The bin is shaken so that one coin ata ±me enters the machine through a large slot. When a coin enters the slot it slides/rolls into ameasuring enclosure. Once the coin is in the measuring enclosure the coin sorter then I. measuresthe diameter of the coinII. measuresthe weight of the coin III. determinesif the coin is bent. IV. comparesan image of each face of the coin to each image in a bank of images showing the expected images for each face of the coin (nickel, dime etc.) The coin Sorter sorts coins into the following types, bent coins, nickels, dimes, quarters, loonies, toonies,and all other coins. The following steps are used to iden±fy the type of a given coin.1. The sorter will determine if the coin is bent a. If the coin is bent it is placed into the bent coin container 2. The bent coin container can hold up to 100g of bent coins.3. If the coin is not bent the coin Sorter will measure the diameter and weight of the coina. If the coin (a coin that is not bent) does not fall into any of the possible weight rangesit is placed in the other coins container.

Presentation on theme: "CMPT 128: Introduction to Computing Science for Engineering Students"— Presentation transcript:

0 CMPT 128 Introduction to Computing Science for Engineering Students
Course Organization

1 CMPT 128: Introduction to Computing Science for Engineering Students
Monday, Wednesday, FridayD100: 12:30-13: D200: 15:30-16:20Textbook:Problem Solving with C++,Walter Savitch, Addison-Wesley, 2012, 9th EditionAdditional References:The C++ Programming Language, third edition, Bjarne Stroustrop, Addision Wesley, 1997:Not easy to read, but this is the definitive C++ reference.© Janice Regan, CMPT 128, Sept

2 Class web-siteAll the information discussed today and more can always be found on the class web-siteYou have received an containing this addressCourse Central is also a useful link to abundant information useful to students taking a computing science course© Janice Regan, CMPT 128, Sept

3 Class web-siteYou can also find links to the class web-site by going toMore useful information for students can be found at© Janice Regan, CMPT 128, Sept

4 © Janice Regan, CMPT 128, Sept. 2007 -2012

5 CMPT 128 Home Page© Janice Regan, CMPT 128, Sept

6 Your Teaching Assistants
© Janice Regan, CMPT 128, Sept

7 CMPT 128 Website© Janice Regan, CMPT 128, Sept

8 My availability© Janice Regan, CMPT 128, Sept

9 CMPT 128 Home Page© Janice Regan, CMPT 128, Sept

10 Evaluation© Janice Regan, CMPT 128, Sept

11 Exceptions to Grading rules
In order to obtain a clear pass (C- or better) you MUSTHave a combined score on the Lab Quizzes and Midterm Quizzes (weighted as indicated on the previous slide) that exceeds 50% (36/72)Have a combined score on lab reports and assignments (weighted as on the previous slide) that exceeds 50% (12/24)© Janice Regan, CMPT 128, Sept

12 Dates of Quizzes© Janice Regan, CMPT 128, Sept

13 In lecture Midterm Quizzes

14 In lab quizzesDuring two of your scheduled lab periods a lab quiz will be given. You will be asked to answer one or two programming questions based on material covered in previous labsYou will be asked to write code that demonstrates your understanding of the concepts practiced in the preceding labs.You will be given 100 minutes to write your code.Your answer will be graded out of 50© Janice Regan, CMPT 128, Sept

15 Assignments Two assignments
Each assignment is worth 8% of your course gradeProblems similar to parts of the assignments may appear on the midterms and the final.Assignments will combine many concepts learned in lectures and the labs© Janice Regan, CMPT 128, Sept

16 Final Exam One 3 hour final examination 50% short answer problems
50% longer problems that utilize several important concepts and require integration of those concepts. Will Include coding (written on paper)A sample exam, including solutions, will be posted two weeks before the final exam© Janice Regan, CMPT 128, Sept

17 Labs Each lab includes two lab problems There will be no labs
In the first week of classes (Sept. 2-5)In the week of November 11Each lab includes two lab problemsFor the first lab you will receive full points for successfully submitting the lab solutionsFor 2 labs you will submit a lab report that will be gradedComplete solutions of all labs will be posted.Lab report solutions will be posted© Janice Regan, CMPT 128, Sept

18 Lab participation / attendance
Lab participation points (you may earn >1.5%)Participation in some labs, awarded by TA’s and instructor ( 0.38% good, 0.75% outstanding)AEP 1%Lab attendance points (you may earn > 1.5% )Attendance in same labsSign in at start of lab, Sign out at end of lab (0.38% per lab)Weeks when there are quizzes or midterms in the lab you will not be able to earn participation or attendance points© Janice Regan, CMPT 128, Sept

19 Assignments, Labs, Solutions
© Janice Regan, CMPT 128, Sept

20 Important Dates© Janice Regan, CMPT 128, Sept

21 Return, Grading questions
Marked work will be returned as soon as possible (1-2 weeks from the due date of the work)You must review your work and the grading when you received the marked work. You have 1 week from the return date to review and submit any questions about grading.© Janice Regan, CMPT 128, Sept

22 AssignmentsAt least two weeks before the due date the assignment will be posted on the websiteAssignments will require you to combine and use many concepts and tools you have learnedAssignments will be much more demanding than lab problems or practice problemsComplete solutions to all assignments will be postedInformation of proper preparation of assignments and lab problems is available on the class website.© Janice Regan, CMPT 128, Sept

23 LabsOn or before Saturday of each week Lab problems will be posted for the next week.Lab Problems are to be completed individually or in a small group (up to five students in the same lab section)Collaboration within your groups is encouragedComplete solutions to all problems will be postedLab reports should be written individually© Janice Regan, CMPT 128, Sept

24 Grading Information Assignments and Lab Reports (and code) should be:
submitted electronically using the course management systemBonus points (5%) are available for submitting assignments or lab reports more than 48 hours earlyNo late assignments or lab problems will be acceptedUnofficial grades will be available on the course management system© Janice Regan, CMPT 128, Sept

25 Required Readings, Notes
© Janice Regan, CMPT 128, Sept

26 Readings and Notes© Janice Regan, CMPT 128, Sept

27 Academic Honesty© Janice Regan, CMPT 128, Sept

28 Academic Honesty Read the policy
© Janice Regan, CMPT 128, Sept

29 Information about the class
Be sure to check your SFU account regularlyregarding the class will be sent to your Campus mail Account, so check it regularly© Janice Regan, CMPT 128, Sept

30 Computing Science Instructional Labs (CSIL)
The CSIL is available for your use at all times beginning in the second week of classes.Either ASB 9838 or ASB 9840 or ASB9700 will be availableIf there is a lab for another course in one or more of these rooms the other will be availableAt particular times the instructor and/or TAs will be available in the lab (ASB 9838) to answer your questions.Instructor and TAs:Tuesday 8:30-12:30Thursday 8:30 – 4:30© Janice Regan, CMPT 128, Sept

31 Finding CSIL labs: 1© Janice Regan, CMPT 128, Sept

32 Finding CSIL labs: 2 CSIL Labs
© Janice Regan, CMPT 128, Sept

33 http://www. sfu. ca/computing/about/school-facilities/access-card
© Janice Regan, CMPT 128, Sept

34 Access to CSIL CSIL is protected by a security card access system
As a student in a computing science course you are eligible to have a security access card for CSILIf you are pre-registered your access card may be picked up from the card office at traffic and security (there is a refundable deposit and a processing fee)© Janice Regan, CMPT 128, Sept

35 CSIL RulesBefore you can use any of the computers in the CSIL you shouldRead the policies governing the use of CSILThese policies can be found on the CMPT web site (see following slides)When you log in you will be asked to confirm that you agree to abide by these policies© Janice Regan, CMPT 128, Sept

36 IMPORTANTRead the Policies© Janice Regan, CMPT 128, Sept

37 Getting Started in CSIL
Before you try programming in CSIL read the information provided for youRead the general information pagesBrowse the FAQs,Now you are ready to startYour CSIL computer ID and password and the ID an password you use for your SFU account.© Janice Regan, CMPT 128, Sept

38 Labs and using CSIL Computers in CSIL are available 24/7
Labs for many classes are scheduled in CSILWhen a lab (not your own) is scheduled in one of the CSIL areas you are requested to work in another area of CSIL. The schedule showing which areas are in use can be found at© Janice Regan, CMPT 128, Sept

39 Required Lab Hours Attendance at Lab hours is required
Lab Hours are held in the Windows area of CSIL labsLab Hours provide an opportunity to work with others sharing knowledge and experience.Lab Hours give you an opportunity to ask the instructor or TA one on one questions about problems and assignments.Lab Hours help you learn the required concepts one by one and allow you to ask questions to assure you understand each one.© Janice Regan, CMPT 128, Sept

40 Reading Assignment Visit and read the information on the class website
Be sure you can findPosted notesReading assignments for each lectureAssignment due datesInstructions on using the CSIL labsInstructions on using your own computer for assignmentsHave any questions ready for next lecture© Janice Regan, CMPT 128, Sept

41 CMPT 128 Introduction to Computing Science for Engineering Students
Computer Components

42 Hardware and SoftwareA computer is a machine designed to perform operations specified with a set of instructions called a program.Hardware refers to the computer equipment.Peripheral Input devices: keyboard, mouse,Peripheral Output devices: screen, disk, DVD, printerProcessing/storage devices: cpu, RAM, ROM, DVDSoftware refers to the programs that describe the steps we want the computer to perform.© Janice Regan, CMPT 128, Sept

43 Computer Hardware CPU – ALU – ROM – RAM – Central processing unit
Arithmetic and logic unitROM –Read only memoryRAM –Random access memoryInternalMemoryExternalMemoryCPUInputDevices?ProcessorOutputDevices?ALUCache/Memory© Janice Regan, CMPT 128, Sept

44 Central Processing Unit (CPU, ALU)
Performs arithmeticThe processor adds, subtracts, multiplies and divides binary numbers using the Arithmetic Logic Unit, ALUMakes comparisonsThe processor can check if two “numbers” are equal, and determine if one is “larger” or “smaller” than the otherMoves bits (binary digits)Knows how to access any RAM (or ROM) addressCan copy data to or from any memory address and its own onboard memory© Janice Regan, CMPT 128, Sept

45 Information storage Primary Storage: RAM, ROM
requires power to store informationSecondary Storage: Disk, DVD, thumb drives, SD cards …Less expensive (so more plentiful)Information persists even without powerStores information that is loaded into primary storage (like programs and data) to be used© Janice Regan, CMPT 128, Sept

46 Example: Command Line UI
Windows Command Prompt© Janice Regan, CMPT 128, Sept

47 Example: Graphical UI (GUI)
Windows explorer© Janice Regan, CMPT 128, Sept

48 Computer Software: Applications
Application Software (Software Tools)Word processors (Microsoft Word, WordPerfect, ...)Spreadsheet programs (Excel, Lotus1-2-3, ...)Computer gamesCommunication software ( , chat, web browser…)Telecommunication software (VOIP, …)Programming environments (Visual Studio, Eclipse)OTHERS?© Janice Regan, CMPT 128, Sept

49 Computer Software: Languages
Some Computer LanguagesMachine language (machine instruction set)assembly languagehigh level languagesC, C++, Ada, Fortran, Basic, JavaDo YOU know of any others?mathematical computation and symbolic manipulation tools (MATLAB, Mathematica, ...)Application software is written using computer languages.© Janice Regan, CMPT 128, Sept

50 Machine languageEach type of processor (like i7, Pentium 4, Athalon, Z80, …) has its own instruction setEach instruction in an instruction set does a single thing like access a piece of data, add two pieces of data, compare two pieces of data …Each instruction is represented by a unique number This # may be different for different instruction sets, but no two instructions in the same instruction set will have the same #© Janice Regan, CMPT 128, Sept

51 Machine Language programs
In machine language a program is a list of instructionsEach instruction is represented by a numberInside the memory of the computer each number is represented in binary (as a constant length string of 1’s and 0’s)The long string of 0’s and 1’s is easy for the computer to understand and very difficult for a Human to read or write© Janice Regan, CMPT 128, Sept

52 Assembler Assembler languages make it easier for the programmer.
Assembler is easier for humans to read/writeThe numbers that identify each of the instructions in the instruction set are replaced with mnemonics like ADD, CMP, …The code, written using these mnemonics is written into a text file.© Janice Regan, CMPT 128, Sept

53 Assembler ProgramsThe code for an Assembler program is written into a text file.The computer read 1’s and 0’s not textHow do we translate to machine readable form?A computer program called a compiler is used to translate the text file (called a source file) containing the assembler code into machine readable codeThe compiler writes a binary file containing the machine readable code (called an object file)© Janice Regan, CMPT 128, Sept

54 Programs in High Level Languages
Assembler is easier to read/write than machine language. It is still very cumbersomeHigh level languages are easier to write than assemblerThe compiler is more complex, but that is a tool you use, not one you writeIn this course we will learn the language C++Many ideas we will discuss in this course are equally applicable to C++ or to any other compiled high level language (C, Fortran, …)© Janice Regan, CMPT 128, Sept

Leave a Comment


Your email address will not be published. Required fields are marked *