26
CS 141 Introduction to Computer Science and Structured Programming Dr. Randy L. Ribler Lynchburg College

CS 141 Introduction to Computer Science and Structured Programming

  • Upload
    kiora

  • View
    78

  • Download
    0

Embed Size (px)

DESCRIPTION

CS 141 Introduction to Computer Science and Structured Programming. Dr. Randy L. Ribler Lynchburg College. First Reading Assignment. Read Bronson Chapter 1. Today’s Topics. Studying computer science Careers in computer science CS141, and where it fits in - PowerPoint PPT Presentation

Citation preview

Page 1: CS 141 Introduction to Computer Science and Structured Programming

CS 141Introduction to Computer Scienceand Structured Programming

Dr. Randy L. Ribler

Lynchburg College

Page 2: CS 141 Introduction to Computer Science and Structured Programming

First Reading Assignment

Read Bronson Chapter 1

Page 3: CS 141 Introduction to Computer Science and Structured Programming

Today’s Topics

Studying computer science Careers in computer science CS141, and where it fits in Hints on how to succeed in this course Compilers and Computer Languages

Page 4: CS 141 Introduction to Computer Science and Structured Programming

What is Computer Science?

Computer science is the study of computers and computer software.

It is really more like an engineering discipline than it is like a science.

Computer science is a very new field of study, yet it already has scores of subfields

Page 5: CS 141 Introduction to Computer Science and Structured Programming

A Sampling of Subfields in Computer Science

Artificial Intelligence (AI) Software Engineering Human-Computer Interaction (HCI) Parallel Processing Computer Graphics Computer Aided Design (CAD) Compiler Development/Tools Robotics

Page 6: CS 141 Introduction to Computer Science and Structured Programming

Simulation Performance Analysis Operating Systems Design Speech/Natural Language Recognition Database Design Theory of computation Virtual Reality (VR) Computer Architecture Web-based Technologies and many, many more.

Page 7: CS 141 Introduction to Computer Science and Structured Programming

What do these subfields have in common? Programming is central to almost every

one of these subfields.

Page 8: CS 141 Introduction to Computer Science and Structured Programming

Good things about Computer Science

You might really enjoy it! It is a very dynamic field

– but the “basics” tend to stay the same It is an applied “science.”

– You should be able to apply virtually everything you learn.

It can provide a very good career It can support work in virtually every

other field

Page 9: CS 141 Introduction to Computer Science and Structured Programming

Programming can be a very creative process. Programmers are writers and

engineers. There are many, many ways to

accomplish the same task. Computer science is very new. There

are a lot of opportunities to be innovative.

You can build new products without investing a lot of cash.

Page 10: CS 141 Introduction to Computer Science and Structured Programming

What do CS majors do when they graduate? Most are hired to develop software (program)

– Productivity Programs

– Operating Systems

– WEB Applications (e-commerce)

– Computer Graphics

– Artificial Intelligence

– Medical Software (CT Scan, MRI)

– Aerospace Applications

– Computation Biology

– Research

– Embedded Systems

– Military Applications

– Business Applications

– Educational Software

– Games

– Movies/Entertainment

Page 11: CS 141 Introduction to Computer Science and Structured Programming

What do CS majors do when they graduate?

Some work as network and system administrators Some go to graduate school Some get research jobs Some teach Some start their own companies

Page 12: CS 141 Introduction to Computer Science and Structured Programming

The Best Jobs in America

http://money.cnn.com/magazines/moneymag/bestjobs/2010/

Page 13: CS 141 Introduction to Computer Science and Structured Programming

Why is CS141 important?

It provides the basic tool set required in virtually every other CS class.

With CS141 and CS142, you can probably get a job as a programmer.

Without at least CS241 and CS242 (or equivalent) you probably shouldn’t be allowed to get a job as a programmer

Page 14: CS 141 Introduction to Computer Science and Structured Programming

Why do many students have trouble in CS141?

It’s probably not how the course is taught.– Every college with a CS program has a

course similar to CS141. – They all have relatively high numbers of

students who have difficulties They underestimate the amount of time they

need to devote to it. They get behind -- and because each concept

builds on the others, it is hard to catch up. They miss classes

Page 15: CS 141 Introduction to Computer Science and Structured Programming

How to Succeed in CS141 Spend time working on the programs Don’t miss any classes Read the textbook as assigned Come to office hours Ask questions in class Stay with the class (Don’t get behind). Start programs as soon as they’re assigned Expect to encounter problems Don’t get frustrated. If you keep trying, you’ll

get it. Understand that the programs are good

teachers -- learn from each mistake. Try to understand everything completly

Page 16: CS 141 Introduction to Computer Science and Structured Programming

Learning to program is like learning to play tennis. At first, you need to master fundamentals. It will get to be much more fun as you become better

at it. You need to practice. You can’t do all the practicing

the night before the match. It might be frustrating at first, but you will be rewarded

if you persevere. You can’t really judge how much you like it until you

get to a certain level of competency. Most people can do it if they dedicate enough time to

it.

Page 17: CS 141 Introduction to Computer Science and Structured Programming

A more gentle introduction is available CS131 (3 credits) MWF 10:00-10:50

– Visual Basic– Recommended for those who have never

done any programming before. CS141 is much more demanding

Page 18: CS 141 Introduction to Computer Science and Structured Programming

What do computers do? They do very, very, simple things

– basic arithmetic on values in memory– Input/Output– Comparison and Conditional Execution

• if-statements

They do it very, very, fast and very, very reliably.

Programmers build systems to do complicated things using these simple basic capabilities.

Page 19: CS 141 Introduction to Computer Science and Structured Programming

Think of a recipe.

We can use instructions that provide different levels of detail.– High Level

• Make an apple pie

– Lower Level• Slice 4 apples into one inch squares...

– Even Lower Level– Pick up a knife, place the knife on the

apple, apply pressure, …

Page 20: CS 141 Introduction to Computer Science and Structured Programming

Cooks use a standard set of instructions Poach Blend Whip Fry Filet

Recipes consist of a known set of instructions.

Cooks translate these higher-level actions.

Page 21: CS 141 Introduction to Computer Science and Structured Programming

Computer Languages

A computer language defines the set of instructions that the programmer can use.

Programs are collections of these instructions.

Page 22: CS 141 Introduction to Computer Science and Structured Programming

Computer Hardware Executes Low-level Instructions

Programmers typically want to write programs using higher level instructions.

Different computer manufactures provide different low-level instructions.

Page 23: CS 141 Introduction to Computer Science and Structured Programming

High-level Languages High-level languages allow

programmers to use a more expressive set of instructions.

A compiler translates the high-level instructions the programmer writes to the low-level instruction set the computer understands.

Compilers allow programs to be portable, because the instructions are not tied to an particular instruction set.

Page 24: CS 141 Introduction to Computer Science and Structured Programming

Compilers Translate High-level instructions to a particular machine’s (native) instruction set.

Program written in High-levelLanguage

Compiler

Program usingnative

instruction set

The program the programmer writes is called source code.

The program the compiler generates is called object code.

Page 25: CS 141 Introduction to Computer Science and Structured Programming

Compilers Translate High-level instructions to a particular machine’s (native) instruction set.

Program written in High-levelLanguage

MicrosoftCompiler

Program using Intel

instruction set

AppleCompiler

Program using Motorola

instruction set

Source code Object code

Page 26: CS 141 Introduction to Computer Science and Structured Programming

Programming Languages FORTRAN - Scientific/Engineering (1957) COBOL - business oriented language (1959) C - applications and systems, dominated much of the

eighties and early nineties. (K&R published 1978) C++ - applications and systems, dominated much of the

late nineties. (1980-1985) Java - applications and network/web-based applications,

rapidly gaining popularity. (1995) Lisp and Prolog - Languages for AI (1959, 1970) Pascal - language used to teach programming (1971) Ada - language used in military applications (1983) Basic - language used to teach programming (1965)