CSC 2000 Midterm Review (Winter 17) - Introduction to C Programming Language Winter Term 2017 Midterm Exam 1 Midterm Exam Two parts Knowledge part

CSC 2000 Midterm Review (Winter 17) - Introduction to C...

This preview shows page 1 - 19 out of 98 pages.

Introduction to C++ Programming Language Winter Term 2017 Midterm Exam 02/28/2017 1
Image of page 1

Subscribe to view the full document.

Midterm Exam Two parts Knowledge part Programming part Picture ID (one card okay) No make-up Exam Slide 1- 2
Image of page 2
Study Book (Chapters 1 – 5) Lecture notes (Chapters 1 – 5) Lecture Assignments Lab Assignments Slide 1- 3
Image of page 3

Subscribe to view the full document.

Midterm Directions Date: Tuesday 02/28, 2017 Time: Class time Location: Class location Exam duration: 100 minutes Closed Book 4-Cheat sheets – Both sides (typed or handwritten) 40 Multiple Choice Questions (160 points) 2 programming questions (40 points) Slide 1- 4
Image of page 4
Chapter 1: An Overview of Computers and Programming Languages
Image of page 5

Subscribe to view the full document.

Central Processing Unit and Main Memory 6
Image of page 6
The Language of a Computer Analog signals : continuous wave forms Digital signals : sequences of 0s and 1s Machine language : language of a computer; a sequence of 0s and 1s Binary digit (bit) : the digit 0 or 1 Binary code (binary number) : a sequence of 0s and 1s 7
Image of page 7

Subscribe to view the full document.

The Language of a Computer (cont’d.) Byte : A sequence of eight bits Kilobyte (KB) : 2 10 bytes = 1024 bytes ASCII (American Standard Code for Information Interchange) 128 characters A is encoded as 1000001 (66th character) 3 is encoded as 0110011 8
Image of page 8
The Language of a Computer (cont’d.) EBCDIC Used by IBM 256 characters Unicode 65536 characters Two bytes are needed to store a character 9
Image of page 9

Subscribe to view the full document.

The Evolution of Programming Languages Early computers were programmed in machine language To calculate wages = rate * hours in machine language: 100100 010001 //Load 100110 010010 //Multiply 100010 010011 //Store 10
Image of page 10
The Evolution of Programming Languages (cont’d.) Using assembly language instructions, wages = rate • hours can be written as: LOAD rate MULT hour STOR wages 11
Image of page 11

Subscribe to view the full document.

The Evolution of Programming Languages (cont’d.) High-level languages include Basic, FORTRAN, COBOL, Pascal, C, C++, C#, and Java Compiler : translates a program written in a high-level language into machine language The equation wages = rate • hours can be written in C++ as: wages = rate * hours; 12
Image of page 12
Processing a C++ Program 13
Image of page 13

Subscribe to view the full document.

The Problem Analysis–Coding– Execution Cycle Algorithm : Step-by-step problem-solving process Solution achieved in finite amount of time 14
Image of page 14
Programming Methodologies Two popular approaches to programming design Structured Object-oriented 15
Image of page 15

Subscribe to view the full document.

Structured Programming Structured design : Dividing a problem into smaller subproblems Structured programming : Implementing a structured design The structured design approach is also called: Top-down (or bottom-up) design Stepwise refinement Modular programming 16
Image of page 16
Object-Oriented Programming Object-oriented design (OOD) Identify components called objects Determine how objects interact with each other Specify relevant data and possible operations to be performed on that data Each object consists of data and operations on that data 17
Image of page 17

Subscribe to view the full document.

ANSI/ISO Standard C++ C++ was designed to implement OOD OOD is used with structured design
Image of page 18
Image of page 19
  • Fall '09

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes