New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Intro to Computer Science

by: Jayden Sun

Intro to Computer Science 1200.010

Jayden Sun

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

1 day of class
Intro to CS
Class Notes
Computer Science
25 ?




Popular in Intro to CS

Popular in Computer science

This 55 page Class Notes was uploaded by Jayden Sun on Tuesday August 23, 2016. The Class Notes belongs to 1200.010 at University of Texas at Dallas taught by in Fall 2016. Since its upload, it has received 6 views. For similar materials see Intro to CS in Computer science at University of Texas at Dallas.

Similar to 1200.010 at UTD

Popular in Computer science


Reviews for Intro to Computer Science


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 08/23/16
Unit 1: Introduction to Computers and Programming (Chapter 1 of Textbook) 1 1.1 Why Program? Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer – person who writes instructions (programs) to make computer perform a task SO, without programmers, no programs; without programs, a computer cannot do anything 3 1.2 Computer Systems: Hardware and Software Main Hardware Component Categories: 1. Central Processing Unit (CPU) 2. Main Memory 3. Secondary Memory / Storage 4. Input Devices 5. Output Devices 5 Main Hardware Component Categories Figure 1-2 6 Central Processing Unit (CPU) Comprised of: Control Unit Retrieves and decodes program instructions Coordinates activities of all other parts of computer Arithmetic & Logic Unit Hardware optimized for high-speed numeric calculation Hardware designed for true/false, yes/no decisions 7 CPU Organization Figure 1-3 8 Example of CPU: A8 of iPhone 6 Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Main Memory It is volatile. Main memory is erased when program terminates or computer is turned off Also called Random Access Memory (RAM) Organized as follows: bit: smallest piece of memory. Has values 0 (off, false) or 1 (on, true) byte: 8 consecutive bits. Bytes have addresses. 10 Main Memory Addresses – Each byte in memory is identified by a unique number known as an address. 11 Main Memory In Figure 1-4, the number 149 is stored in the byte with the address 16, and the number 72 is stored at address 23. 12 Secondary Storage Non-volatile: data retained when program is not running or computer is turned off Comes in a variety of media: magnetic: floppy disk, hard drive optical: CD-ROM, DVD Flash drives, connected to the USB port 13 Input Devices Devices that send information to the computer from outside Many devices can provide input: Keyboard, mouse, scanner, digital camera, microphone Disk drives, CD drives, and DVD drives 14 Software-Programs That Run on a Computer Categories of software: System software: programs that manage the computer hardware and the programs that run on them. Examples: operating systems, utility programs, software development tools Application software: programs that provide services to the user. Examples : word processing, games, programs to solve specific problems 15 1.3 Programs and Programming Languages Programs and Programming Languages A program is a set of instructions that the computer follows to perform a task We start with an algorithm, which is a set of well-defined steps. 17 Example Algorithm for Calculating Gross Pay 18 Machine Language Although the previous algorithm defines the steps for calculating the gross pay, it is not ready to be executed on the computer. The computer only executes machine language instructions 19 Machine Language Machine language instructions are binary numbers, such as 1011010000000101 Rather than writing programs in machine language, programmers use programming languages. 20 Programs and Programming Languages Types of languages: Low-level: used for communication with computer hardware directly. Often written in binary machine code (0’s/1’s) directly. High-level: closer to human language 21 Some Well-Known Programming Languages (Table 1-1 on Page 10) C++ BASIC Ruby Java FORTRAN Visual Basic COBOL C# JavaScript C Python 22 From a High-Level Program to an Executable File a) Create file containing the program with a text editor. b) Run preprocessor to convert source file directives to source code program statements. c) Run compiler to convert source program into machine instructions. d) Run linker to connect hardware-specific code to machine instructions, producing an executable file. Steps b–d are often performed by a single command or button click. Errors detected at any step will prevent execution of following steps. 23 From a High-Level Program to an Executable File 24 Integrated Development Environments (IDEs) An integrated development environment, or IDE, combine all the tools needed to write, compile, and debug a program into a single software application. Examples are Microsoft Visual C++, CodeBlocks, Eclipse, Turbo C++ Explorer, CodeWarrior, etc. 25 Integrated Development Environments (IDEs) 26 1.4 What is a Program Made of? What is a Program Made of? Common elements in programming languages: Key Words Programmer-Defined Identifiers Operators Punctuation Syntax 28 Program 1-1 29 Key Words Also known as reserved words Have a special meaning in C++ Can not be used for any other purpose Key words in the Program 1-1: using, namespace, int, double, and return 30 Key Words 31 Programmer-Defined Identifiers Names made up by the programmer Not part of the C++ language Used to represent various things: variables (memory locations), functions, etc. In Program 1-1: hours, rate, and pay. 32 Operators Used to perform operations on data Many types of operators: Arithmetic - ex: +,-,*,/ Assignment – ex: = Some operators in Program1-1: << >> = * 33 Operators 34 Punctuation Characters that mark the end of a statement, or that separate items in a list In Program 1-1: , and ; 35 Punctuation 36 Syntax The rules of grammar that must be followed when writing a program Controls the use of key words, operators, programmer-defined symbols, and punctuation 37 Variables A variable is a named storage location in the computer’s memory for holding a piece of data. In Program 1-1 we used three variables: The hours variable was used to hold the hours worked The rate variable was used to hold the pay rate The pay variable was used to hold the gross pay 38 Variable Definitions To create a variable in a program you must write a variable definition (also called a variable declaration) Here is the statement from Program 1-1 that defines the variables: double hours, rate, pay; 39 Variable Definitions There are many different types of data, which you will learn about in this course. A variable holds a specific type of data. The variable definition specifies the type of data a variable can hold, and the variable name. 40 Variable Definitions Once again, line 7 from Program 1-1: double hours, rate, pay; The word double specifies that the variables can hold double-precision floating point numbers. (You will learn more about that in Chapter 2) 41 1.5 Input, Processing, and Output Input, Processing, and Output Three steps that a program typically performs: 1) Gather input data: from keyboard from files on disk drives 2) Process the input data 3) Display the results as output: send it to the screen write to a file 43 1.6 The Programming Process The Programming Process 45 Pseudocode Pseudocode is a cross between human language and a programming language Pseudocode is not source code that can generate an executable code Not as detailed as a real source code 46 Pseudocode Pseudocode is closer to programming language than human language Less ambiguous than human language Often convenient to use pseudocode to describe an algorithm or outline a program before writing the real code Check the logic correctness without having to worry about the details of the language (syntax, punctuation, etc.) 47 Pseudocode Pseudocode can be used at various levels of detail Ranging from high level outline to more detailed version More detailed version may be converted more easily to a C++ source code 48 Pseudocode High level outline More detailed version Get payroll data Display “How many hours Calculate gross did you work?” pay Input hours Display gross pay Display “What is your hourly rate?” Input rate Set pay to hours multiplied by rate Display the value of pay 49 Pseudocode to C++ code Pseudocode C++ code Display “How many hours did cout << “How many hours did you work?” you work?”; Input hours cin >> hours; Display “What is your hourly cout << “What is your hourly rate?” rate?” Input rate cin >> rate; Set pay to hours multiplied by pay = hours * rate; rate cout << pay; Display the value of pay 50 Pseudocode Pseudocode usually consists only of executable statements Display Input Set pay to hours multiplied by rate Etc. Does not include definitions in the pseudocode double hours, rate, pay; 51 Flowcharts 52 Flowcharts - Connectors 53 Pseudocode and Flowchart Exercises Get scores of 3 test scores, calculate and display the average Get radius, calculate and display area and circumference of circle Get item prices, calculate total price and add sales tax, then display total More on pseudocode and flowcharts later 54 Reading Assignment Read chapter 1 of textbook and do the checkpoints, but leave out 1.7 55


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Anthony Lee UC Santa Barbara

"I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.